diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a1e4e35b..fc1b52ad 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -354,7 +354,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 88; + CURRENT_PROJECT_VERSION = 96; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -362,7 +362,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.88; + MARKETING_VERSION = 1.0.96; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -484,7 +484,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 88; + CURRENT_PROJECT_VERSION = 96; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -492,7 +492,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.88; + MARKETING_VERSION = 1.0.96; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -508,7 +508,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 88; + CURRENT_PROJECT_VERSION = 96; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -516,7 +516,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.88; + MARKETING_VERSION = 1.0.96; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/data/model/app/menu_item.dart b/lib/data/model/app/menu_item.dart index 0ca6fedb..52c7c840 100644 --- a/lib/data/model/app/menu_item.dart +++ b/lib/data/model/app/menu_item.dart @@ -11,13 +11,14 @@ class MenuItem { } class MenuItems { - static const List firstItems = [sftp, snippet, apt]; + static const List firstItems = [ssh, sftp, snippet, apt]; static const List secondItems = [edit]; + static const ssh = MenuItem(text: 'SSH', icon: Icons.link); static const sftp = MenuItem(text: 'SFTP', icon: Icons.file_present); static const snippet = MenuItem(text: 'Snippet', icon: Icons.label); static const apt = MenuItem(text: 'Apt', icon: Icons.system_security_update); - static const edit = MenuItem(text: 'Edit', icon: Icons.settings); + static const edit = MenuItem(text: 'Edit', icon: Icons.edit); static Widget buildItem(MenuItem item) { return Row( diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 1e01cbfc..a49566b7 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,9 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 95; + static const int build = 97; static const String engine = "Flutter 2.10.0 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 5f105a6ca7 (7 days ago) • 2022-02-01 14:15:42 -0800\nEngine • revision 776efd2034\nTools • Dart 2.16.0 • DevTools 2.9.2\n"; - static const String buildAt = "2022-02-08 21:30:51.218738"; - static const int modifications = 3; + static const String buildAt = "2022-02-09 10:58:45.586008"; + static const int modifications = 8; } diff --git a/lib/data/res/tab.dart b/lib/data/res/tab.dart index 01b9a8ee..004e937d 100644 --- a/lib/data/res/tab.dart +++ b/lib/data/res/tab.dart @@ -3,7 +3,7 @@ import 'package:toolbox/data/model/app/navigation_item.dart'; final List tabs = ['Servers', 'En/Decode', 'Ping']; final List tabItems = [ - NavigationItem(Icons.computer, 'Server'), + NavigationItem(Icons.cloud, 'Server'), NavigationItem(Icons.code, 'Convert'), - NavigationItem(Icons.network_check, 'Ping'), + NavigationItem(Icons.leak_add, 'Ping'), ]; diff --git a/lib/view/page/home.dart b/lib/view/page/home.dart index 499000b3..4f367b94 100644 --- a/lib/view/page/home.dart +++ b/lib/view/page/home.dart @@ -213,39 +213,48 @@ class _MyHomePageState extends State SizedBox( height: MediaQuery.of(context).size.height * 0.07, ), - ListTile( - leading: const Icon(Icons.settings), - title: const Text('Setting'), - onTap: () => AppRoute(const SettingPage(), 'Setting').go(context), - ), - ListTile( - leading: const Icon(Icons.vpn_key), - title: const Text('Private Key'), - onTap: () => - AppRoute(const StoredPrivateKeysPage(), 'private key list') - .go(context), - ), - ListTile( - leading: const Icon(Icons.snippet_folder), - title: const Text('Snippet'), - onTap: () => - AppRoute(const SnippetListPage(), 'snippet list').go(context), - ), - AboutListTile( - icon: const Icon(Icons.text_snippet), - child: const Text('Licences'), - applicationName: BuildData.name, - applicationVersion: _buildVersionStr(), - applicationIcon: _buildIcon(), - aboutBoxChildren: const [ - UrlText( - text: '\nMade with ❤️ by $myGithub', replace: 'LollipopKit'), - UrlText( - text: - '\nThanks $rainSunMeGithub for participating in the test.\n\nAll rights reserved.', - replace: 'RainSunMe', - ), - ], + Padding( + padding: const EdgeInsets.only(left: 29), + child: Column( + children: [ + ListTile( + leading: const Icon(Icons.settings), + title: const Text('Setting'), + onTap: () => + AppRoute(const SettingPage(), 'Setting').go(context), + ), + ListTile( + leading: const Icon(Icons.vpn_key), + title: const Text('Private Key'), + onTap: () => AppRoute( + const StoredPrivateKeysPage(), 'private key list') + .go(context), + ), + ListTile( + leading: const Icon(Icons.snippet_folder), + title: const Text('Snippet'), + onTap: () => AppRoute(const SnippetListPage(), 'snippet list') + .go(context), + ), + AboutListTile( + icon: const Icon(Icons.text_snippet), + child: const Text('Licences'), + applicationName: BuildData.name, + applicationVersion: _buildVersionStr(), + applicationIcon: _buildIcon(), + aboutBoxChildren: const [ + UrlText( + text: '\nMade with ❤️ by $myGithub', + replace: 'LollipopKit'), + UrlText( + text: + '\nThanks $rainSunMeGithub for participating in the test.\n\nAll rights reserved.', + replace: 'RainSunMe', + ), + ], + ) + ], + ), ), ], ), diff --git a/lib/view/page/ping.dart b/lib/view/page/ping.dart index 16a3fe6f..591e32c8 100644 --- a/lib/view/page/ping.dart +++ b/lib/view/page/ping.dart @@ -18,15 +18,13 @@ class PingPage extends StatefulWidget { class _PingPageState extends State with AutomaticKeepAliveClientMixin { late TextEditingController _textEditingController; - late TextEditingController _textEditingControllerResult; - late String _result; + String _result = ''; Ping? _ping; @override void initState() { super.initState(); _textEditingController = TextEditingController(text: ''); - _textEditingControllerResult = TextEditingController(text: ''); if (Platform.isIOS) { DartPingIOS.register(); } @@ -48,7 +46,12 @@ class _PingPageState extends State const SizedBox(height: 13), buildInput(context, _textEditingController, maxLines: 1), _buildControl(), - buildInput(context, _textEditingControllerResult), + RoundRectCard( + SizedBox( + width: double.infinity, + child: Padding(padding: const EdgeInsets.all(7), child: Text(_result)), + ), + ), ])), onTap: () => FocusScope.of(context).requestFocus(FocusNode()), ), @@ -62,7 +65,7 @@ class _PingPageState extends State final resp = event.response.toString(); if (resp == 'null') return; _result += '$resp\n'; - _textEditingControllerResult.text = _result; + setState(() {}); }); } diff --git a/lib/view/page/server/tab.dart b/lib/view/page/server/tab.dart index 8d697e4f..f497269b 100644 --- a/lib/view/page/server/tab.dart +++ b/lib/view/page/server/tab.dart @@ -175,70 +175,7 @@ class _ServerPageState extends State style: style), ) : Text(topRightStr, style: style, textScaleFactor: 1.0), - DropdownButtonHideUnderline( - child: DropdownButton2( - customButton: const Padding( - padding: EdgeInsets.only(left: 7), - child: Icon( - Icons.more_vert, - size: 17, - ), - ), - customItemsIndexes: const [3], - customItemsHeight: 8, - items: [ - ...MenuItems.firstItems.map( - (item) => DropdownMenuItem( - value: item, - child: MenuItems.buildItem(item), - ), - ), - const DropdownMenuItem( - enabled: false, child: Divider()), - ...MenuItems.secondItems.map( - (item) => DropdownMenuItem( - value: item, - child: MenuItems.buildItem(item), - ), - ), - ], - onChanged: (value) { - final item = value as MenuItem; - switch (item) { - case MenuItems.apt: - case MenuItems.sftp: - showSnackBar( - context, const Text('Now is not supported')); - break; - case MenuItems.snippet: - AppRoute( - SnippetListPage( - spi: spi, - ), - 'snippet list') - .go(context); - break; - case MenuItems.edit: - AppRoute( - ServerEditPage( - spi: spi, - ), - 'Edit server info page') - .go(context); - break; - } - }, - itemHeight: 37, - itemPadding: const EdgeInsets.only(left: 17, right: 17), - dropdownWidth: 160, - dropdownPadding: const EdgeInsets.symmetric(vertical: 7), - dropdownDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(7), - ), - dropdownElevation: 8, - offset: const Offset(0, 8), - ), - ), + _buildMoreBtn(spi), ], ) ], @@ -272,6 +209,72 @@ class _ServerPageState extends State ); } + Widget _buildMoreBtn(ServerPrivateInfo spi) { + return DropdownButtonHideUnderline( + child: DropdownButton2( + customButton: const Padding( + padding: EdgeInsets.only(left: 7), + child: Icon( + Icons.more_vert, + size: 17, + ), + ), + customItemsIndexes: [MenuItems.firstItems.length], + customItemsHeight: 8, + items: [ + ...MenuItems.firstItems.map( + (item) => DropdownMenuItem( + value: item, + child: MenuItems.buildItem(item), + ), + ), + const DropdownMenuItem(enabled: false, child: Divider()), + ...MenuItems.secondItems.map( + (item) => DropdownMenuItem( + value: item, + child: MenuItems.buildItem(item), + ), + ), + ], + onChanged: (value) { + final item = value as MenuItem; + switch (item) { + case MenuItems.ssh: + case MenuItems.apt: + case MenuItems.sftp: + showSnackBar(context, const Text('Now is not supported')); + break; + case MenuItems.snippet: + AppRoute( + SnippetListPage( + spi: spi, + ), + 'snippet list') + .go(context); + break; + case MenuItems.edit: + AppRoute( + ServerEditPage( + spi: spi, + ), + 'Edit server info page') + .go(context); + break; + } + }, + itemHeight: 37, + itemPadding: const EdgeInsets.only(left: 17, right: 17), + dropdownWidth: 160, + dropdownPadding: const EdgeInsets.symmetric(vertical: 7), + dropdownDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(7), + ), + dropdownElevation: 8, + offset: const Offset(0, 8), + ), + ); + } + Widget _buildExplainText(String text) { return SizedBox( width: _media.size.width * 0.2, diff --git a/make.dart b/make.dart index 91ba4143..bad99210 100755 --- a/make.dart +++ b/make.dart @@ -44,12 +44,13 @@ Future getFlutterVersion() async { } Future> getBuildData() async { + final modifiedCount = await getGitModificationCount(); final data = { 'name': appName, - 'build': await getGitCommitCount(), + 'build': await getGitCommitCount() + (modifiedCount == 0 ? 0 : 1), 'engine': await getFlutterVersion(), 'buildAt': DateTime.now().toString(), - 'modifications': await getGitModificationCount(), + 'modifications': modifiedCount, }; return data; } @@ -69,7 +70,7 @@ Future updateBuildData() async { void dartFormat() { final result = Process.runSync('dart', ['format', '.']); - print(result.stdout); + print('\n' + result.stdout); if (result.exitCode != 0) { print(result.stderr); exit(1); @@ -83,7 +84,8 @@ void flutterRun(String? mode) { Future flutterBuild(String source, String target, bool isAndroid) async { final startTime = DateTime.now(); - final build = await getGitCommitCount(); + final build = await getGitCommitCount() + + (await getGitModificationCount() == 0 ? 0 : 1); final args = [ 'build', diff --git a/pubspec.lock b/pubspec.lock index f559d284..7875b243 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -335,13 +335,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" meta: dependency: transitive description: @@ -528,7 +521,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.3" typed_data: dependency: transitive description: