mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
更新编译脚本、优化初始化ServerStatus、更改为英文
This commit is contained in:
@@ -29,8 +29,6 @@
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
|
||||
@@ -28,7 +28,7 @@ class ServerProvider extends BusyProvider {
|
||||
usedPercent: 0)
|
||||
],
|
||||
sysVer: '',
|
||||
uptime: '',
|
||||
uptime: 'Connecting...',
|
||||
tcp: TcpStatus(maxConn: 0, active: 0, passive: 0, fail: 0));
|
||||
|
||||
Future<void> loadLocalData() async {
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
class BuildData {
|
||||
static const String name = "ToolBox";
|
||||
static const int build = 15;
|
||||
static const String engine = "Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision ffb2ecea52 (2 weeks ago) • 2021-09-17 15:26:33 -0400\nEngine • revision b3af521a05\nTools • Dart 2.14.2\n";
|
||||
static const String engine =
|
||||
"Flutter 2.5.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision ffb2ecea52 (2 weeks ago) • 2021-09-17 15:26:33 -0400\nEngine • revision b3af521a05\nTools • Dart 2.14.2\n";
|
||||
static const String buildAt = "2021-10-02 19:52:07.676336";
|
||||
static const int modifications = 71;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class _ConvertPageState extends State<ConvertPage>
|
||||
case 3:
|
||||
return Uri.decodeFull(text);
|
||||
default:
|
||||
return '未知编码';
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
AutomaticKeepAliveClientMixin,
|
||||
SingleTickerProviderStateMixin,
|
||||
AfterLayoutMixin {
|
||||
final List<String> _tabs = ['服务器', '编/解码'];
|
||||
final List<String> _tabs = ['Servers', 'En/Decode'];
|
||||
late final TabController _tabController;
|
||||
|
||||
@override
|
||||
@@ -65,7 +65,7 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
UserAccountsDrawerHeader(
|
||||
accountName: const Text('ToolBox'),
|
||||
accountEmail: Text(_buildVersionStr()),
|
||||
currentAccountPicture: _buildIcon(const Color(0x00083963)),
|
||||
currentAccountPicture: _buildIcon(),
|
||||
),
|
||||
// const ListTile(
|
||||
// leading: Icon(Icons.settings),
|
||||
@@ -73,10 +73,10 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
// ),
|
||||
AboutListTile(
|
||||
icon: const Icon(Icons.text_snippet),
|
||||
child: const Text('开源证书'),
|
||||
child: const Text('Open source licenses'),
|
||||
applicationName: BuildData.name,
|
||||
applicationVersion: _buildVersionStr(),
|
||||
applicationIcon: _buildIcon(Colors.transparent),
|
||||
applicationIcon: _buildIcon(),
|
||||
aboutBoxChildren: const [
|
||||
Text('''\nMade with Love.
|
||||
\nAll rights reserved.'''),
|
||||
@@ -87,10 +87,21 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildIcon(Color c) {
|
||||
return CircleAvatar(
|
||||
child: Image.asset('assets/app_icon.jpg'),
|
||||
backgroundColor: c,
|
||||
Widget _buildIcon() {
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 60, maxWidth: 60),
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
color: Colors.white,
|
||||
height: 37,
|
||||
width: 37,
|
||||
),
|
||||
),
|
||||
Image.asset('assets/app_icon.jpg'),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,13 +83,13 @@ class _ServerPageState extends State<ServerPage>
|
||||
}
|
||||
|
||||
void showAddServerDialog() {
|
||||
showRoundDialog(context, '新建服务器连接', _buildTextInputField(context), [
|
||||
showRoundDialog(context, 'New', _buildTextInputField(context), [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
clearTextField();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('关闭')),
|
||||
child: const Text('Close')),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
final authorization = keyController.text.isEmpty
|
||||
@@ -107,7 +107,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
clearTextField();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('连接'))
|
||||
child: const Text('Connect'))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -124,12 +124,12 @@ class _ServerPageState extends State<ServerPage>
|
||||
TextField(
|
||||
controller: nameController,
|
||||
keyboardType: TextInputType.text,
|
||||
decoration: _buildDecoration('名称'),
|
||||
decoration: _buildDecoration('Name'),
|
||||
),
|
||||
TextField(
|
||||
controller: ipController,
|
||||
keyboardType: TextInputType.text,
|
||||
decoration: _buildDecoration('IP'),
|
||||
decoration: _buildDecoration('Host'),
|
||||
),
|
||||
TextField(
|
||||
controller: portController,
|
||||
@@ -139,19 +139,19 @@ class _ServerPageState extends State<ServerPage>
|
||||
TextField(
|
||||
controller: usernameController,
|
||||
keyboardType: TextInputType.text,
|
||||
decoration: _buildDecoration('用户名'),
|
||||
decoration: _buildDecoration('User'),
|
||||
),
|
||||
TextField(
|
||||
controller: keyController,
|
||||
keyboardType: TextInputType.text,
|
||||
decoration: _buildDecoration('密钥(可选)'),
|
||||
decoration: _buildDecoration('Key(Optional)'),
|
||||
onSubmitted: (_) => {},
|
||||
),
|
||||
TextField(
|
||||
controller: passwordController,
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.text,
|
||||
decoration: _buildDecoration('密码'),
|
||||
decoration: _buildDecoration('Pwd'),
|
||||
onSubmitted: (_) => {},
|
||||
),
|
||||
],
|
||||
@@ -186,7 +186,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
|
||||
showRoundDialog(
|
||||
context,
|
||||
'修改服务器信息',
|
||||
'Edit',
|
||||
_buildTextInputField(context),
|
||||
[
|
||||
TextButton(
|
||||
@@ -194,7 +194,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
clearTextField();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('关闭')),
|
||||
child: const Text('Close')),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
final authorization = keyController.text.isEmpty
|
||||
@@ -214,7 +214,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
clearTextField();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('保存')),
|
||||
child: const Text('Save')),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
serverProvider.delServer(spi);
|
||||
@@ -222,7 +222,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text(
|
||||
'删除',
|
||||
'Delete',
|
||||
style: TextStyle(color: Colors.red),
|
||||
))
|
||||
],
|
||||
|
||||
@@ -67,8 +67,8 @@ Future<void> updateBuildData() async {
|
||||
await writeStaicConfigFile(data, 'BuildData', path);
|
||||
}
|
||||
|
||||
void flutterRun() {
|
||||
Process.start('flutter', ['run'],
|
||||
void flutterRun(String? mode) {
|
||||
Process.start('flutter', ['run', mode == null ? '' : '--$mode'],
|
||||
mode: ProcessStartMode.inheritStdio, runInShell: true);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void main(List<String> args) async {
|
||||
|
||||
switch (command) {
|
||||
case 'run':
|
||||
return flutterRun();
|
||||
return flutterRun(args.length == 2 ? args[1] : null);
|
||||
case 'build':
|
||||
if (args.length > 1) {
|
||||
await updateBuildData();
|
||||
|
||||
Reference in New Issue
Block a user