From 07dbab3e09c97813f86ae3752ee424f3111227c2 Mon Sep 17 00:00:00 2001
From: LollipopKit <2036293523@qq.com>
Date: Sun, 24 Oct 2021 20:48:54 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BC=96=E8=AF=91=E8=84=9A?=
=?UTF-8?q?=E6=9C=AC=E3=80=81=E4=BC=98=E5=8C=96=E5=88=9D=E5=A7=8B=E5=8C=96?=
=?UTF-8?q?ServerStatus=E3=80=81=E6=9B=B4=E6=94=B9=E4=B8=BA=E8=8B=B1?=
=?UTF-8?q?=E6=96=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ios/Runner/Info.plist | 2 --
lib/data/provider/server.dart | 2 +-
lib/data/res/build_data.dart | 3 ++-
lib/view/page/convert.dart | 2 +-
lib/view/page/home.dart | 27 +++++++++++++++++++--------
lib/view/page/server.dart | 24 ++++++++++++------------
make.dart | 6 +++---
7 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 89604ce6..84df3993 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -29,8 +29,6 @@
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
- UIInterfaceOrientationLandscapeLeft
- UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
diff --git a/lib/data/provider/server.dart b/lib/data/provider/server.dart
index cfec1069..5cb4e60f 100644
--- a/lib/data/provider/server.dart
+++ b/lib/data/provider/server.dart
@@ -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 loadLocalData() async {
diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart
index 1062638e..35a6045f 100644
--- a/lib/data/res/build_data.dart
+++ b/lib/data/res/build_data.dart
@@ -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;
}
diff --git a/lib/view/page/convert.dart b/lib/view/page/convert.dart
index 6e13bda3..6084a42c 100644
--- a/lib/view/page/convert.dart
+++ b/lib/view/page/convert.dart
@@ -88,7 +88,7 @@ class _ConvertPageState extends State
case 3:
return Uri.decodeFull(text);
default:
- return '未知编码';
+ return 'Unknown';
}
}
diff --git a/lib/view/page/home.dart b/lib/view/page/home.dart
index f4e1e653..e5aa99a5 100644
--- a/lib/view/page/home.dart
+++ b/lib/view/page/home.dart
@@ -24,7 +24,7 @@ class _MyHomePageState extends State
AutomaticKeepAliveClientMixin,
SingleTickerProviderStateMixin,
AfterLayoutMixin {
- final List _tabs = ['服务器', '编/解码'];
+ final List _tabs = ['Servers', 'En/Decode'];
late final TabController _tabController;
@override
@@ -65,7 +65,7 @@ class _MyHomePageState extends State
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
// ),
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
);
}
- 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'),
+ ],
+ ),
);
}
diff --git a/lib/view/page/server.dart b/lib/view/page/server.dart
index 8f4a0bb6..59c824d7 100644
--- a/lib/view/page/server.dart
+++ b/lib/view/page/server.dart
@@ -83,13 +83,13 @@ class _ServerPageState extends State
}
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
clearTextField();
Navigator.of(context).pop();
},
- child: const Text('连接'))
+ child: const Text('Connect'))
]);
}
@@ -124,12 +124,12 @@ class _ServerPageState extends State
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
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
showRoundDialog(
context,
- '修改服务器信息',
+ 'Edit',
_buildTextInputField(context),
[
TextButton(
@@ -194,7 +194,7 @@ class _ServerPageState extends State
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
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
Navigator.of(context).pop();
},
child: const Text(
- '删除',
+ 'Delete',
style: TextStyle(color: Colors.red),
))
],
diff --git a/make.dart b/make.dart
index e832310f..a37dd41f 100755
--- a/make.dart
+++ b/make.dart
@@ -67,8 +67,8 @@ Future 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 args) async {
switch (command) {
case 'run':
- return flutterRun();
+ return flutterRun(args.length == 2 ? args[1] : null);
case 'build':
if (args.length > 1) {
await updateBuildData();