更新编译脚本、优化初始化ServerStatus、更改为英文

This commit is contained in:
LollipopKit
2021-10-24 20:48:54 +08:00
parent 554173bda5
commit 07dbab3e09
7 changed files with 38 additions and 28 deletions

View File

@@ -88,7 +88,7 @@ class _ConvertPageState extends State<ConvertPage>
case 3:
return Uri.decodeFull(text);
default:
return '未知编码';
return 'Unknown';
}
}

View File

@@ -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'),
],
),
);
}

View File

@@ -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),
))
],