mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
新增抽屉
This commit is contained in:
@@ -43,7 +43,8 @@ class _EncodePageState extends State<EncodePage>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: SingleChildScrollView(
|
body: GestureDetector(
|
||||||
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 7),
|
padding: const EdgeInsets.symmetric(horizontal: 7),
|
||||||
child: AnimationLimiter(
|
child: AnimationLimiter(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -61,7 +62,10 @@ class _EncodePageState extends State<EncodePage>
|
|||||||
_buildTypeOption(),
|
_buildTypeOption(),
|
||||||
_buildResult(),
|
_buildResult(),
|
||||||
],
|
],
|
||||||
)))),
|
))),
|
||||||
|
),
|
||||||
|
onTap: () => FocusScope.of(context).requestFocus(FocusNode()),
|
||||||
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_textEditingControllerResult.text = doConvert();
|
_textEditingControllerResult.text = doConvert();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:toolbox/core/route.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/convert.dart';
|
||||||
import 'package:toolbox/page/debug.dart';
|
import 'package:toolbox/page/debug.dart';
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
drawer: _buildDrawer(),
|
||||||
body: TabBarView(controller: _tabController, children: const [
|
body: TabBarView(controller: _tabController, children: const [
|
||||||
EncodePage(),
|
EncodePage(),
|
||||||
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
|
@override
|
||||||
bool get wantKeepAlive => true;
|
bool get wantKeepAlive => true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user