mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
新增抽屉
This commit is contained in:
@@ -43,7 +43,8 @@ class _EncodePageState extends State<EncodePage>
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
body: GestureDetector(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||
child: AnimationLimiter(
|
||||
child: Column(
|
||||
@@ -61,7 +62,10 @@ class _EncodePageState extends State<EncodePage>
|
||||
_buildTypeOption(),
|
||||
_buildResult(),
|
||||
],
|
||||
)))),
|
||||
))),
|
||||
),
|
||||
onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
_textEditingControllerResult.text = doConvert();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/core/route.dart';
|
||||
import 'package:toolbox/data/res/build_data.dart';
|
||||
import 'package:toolbox/page/convert.dart';
|
||||
import 'package:toolbox/page/debug.dart';
|
||||
|
||||
@@ -37,6 +38,7 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
controller: _tabController,
|
||||
),
|
||||
),
|
||||
drawer: _buildDrawer(),
|
||||
body: TabBarView(controller: _tabController, children: const [
|
||||
EncodePage(),
|
||||
EncodePage(),
|
||||
@@ -47,6 +49,38 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildDrawer() {
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
UserAccountsDrawerHeader(
|
||||
accountName: const Text('ToolBox'),
|
||||
accountEmail: Text(_buildVersionStr()),
|
||||
),
|
||||
const ListTile(
|
||||
leading: Icon(Icons.settings),
|
||||
title: Text('设置'),
|
||||
),
|
||||
AboutListTile(
|
||||
icon: const Icon(Icons.text_snippet),
|
||||
child: const Text('开源证书'),
|
||||
applicationName: BuildData.name,
|
||||
applicationVersion: _buildVersionStr(),
|
||||
aboutBoxChildren: const [
|
||||
Text('''\nMade with ❤️ by Toast Studio .
|
||||
\nAll rights reserved.'''),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String _buildVersionStr() {
|
||||
return 'Ver: 1.0.${BuildData.build}';
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user