mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
初始化服务器状态页
This commit is contained in:
45
lib/view/page/debug.dart
Normal file
45
lib/view/page/debug.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:toolbox/data/provider/debug.dart';
|
||||
|
||||
class DebugPage extends StatefulWidget {
|
||||
const DebugPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DebugPageState createState() => _DebugPageState();
|
||||
}
|
||||
|
||||
class _DebugPageState extends State<DebugPage> {
|
||||
DebugProvider get debug => Provider.of<DebugProvider>(context);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar:
|
||||
AppBar(title: const Text('Terminal'), backgroundColor: Colors.black),
|
||||
body: _buildTerminal(context),
|
||||
backgroundColor: Colors.black,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTerminal(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
color: Colors.black,
|
||||
child: DefaultTextStyle(
|
||||
style: const TextStyle(
|
||||
fontFamily: 'monospace',
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: debug.widgets,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user