mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
61 lines
1.7 KiB
Dart
61 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:toolbox/core/extension/context/common.dart';
|
|
import 'package:toolbox/data/provider/debug.dart';
|
|
import 'package:toolbox/data/res/provider.dart';
|
|
|
|
import '../widget/appbar.dart';
|
|
|
|
class DebugPage extends StatefulWidget {
|
|
const DebugPage({super.key});
|
|
|
|
@override
|
|
_DebugPageState createState() => _DebugPageState();
|
|
}
|
|
|
|
class _DebugPageState extends State<DebugPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: CustomAppBar(
|
|
leading: IconButton(
|
|
onPressed: () => context.pop(),
|
|
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
|
),
|
|
title: const Text('Logs', style: TextStyle(color: Colors.white)),
|
|
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: ChangeNotifierProvider(
|
|
create: (_) => Pros.debug,
|
|
child: Consumer<DebugProvider>(
|
|
builder: (_, debug, __) {
|
|
return Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: debug.widgets,
|
|
);
|
|
},
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|