From 3ccb61fba2d79f728a919b066da43957c9476719 Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Tue, 23 Apr 2024 19:49:02 +0800 Subject: [PATCH] opt. --- ios/Runner.xcodeproj/project.pbxproj | 36 +++++++++++++------------- lib/core/utils/platform/base.dart | 6 ----- lib/data/res/build_data.dart | 6 ++--- lib/view/page/setting/entry.dart | 32 +++++++++++------------ macos/Runner.xcodeproj/project.pbxproj | 12 ++++----- pubspec.lock | 4 +-- pubspec.yaml | 2 +- 7 files changed, 45 insertions(+), 53 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 73d25a08b..f66f714e5 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -672,7 +672,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -682,7 +682,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -808,7 +808,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -818,7 +818,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -836,7 +836,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -846,7 +846,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -867,7 +867,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -880,7 +880,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; @@ -906,7 +906,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -919,7 +919,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -942,7 +942,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; @@ -955,7 +955,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -978,7 +978,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -990,7 +990,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; @@ -1019,7 +1019,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1031,7 +1031,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; @@ -1057,7 +1057,7 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_PREVIEWS = YES; @@ -1069,7 +1069,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd; PRODUCT_NAME = ServerBox; diff --git a/lib/core/utils/platform/base.dart b/lib/core/utils/platform/base.dart index bbc711c0c..31ead3581 100644 --- a/lib/core/utils/platform/base.dart +++ b/lib/core/utils/platform/base.dart @@ -44,12 +44,6 @@ enum OS { OS.ios => 'iOS', final val => val.name.upperFirst, }; - - /// Whether has platform specific settings. - static final hasSpecSetting = switch (type) { - OS.android || OS.ios => true, - _ => false, - }; } final isAndroid = OS.type == OS.android; diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index e300ef2ef..ab44c9efa 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 = 871; + static const int build = 872; static const String engine = "3.19.5"; - static const String buildAt = "2024-04-23 13:44:51"; - static const int modifications = 6; + static const String buildAt = "2024-04-23 15:08:31"; + static const int modifications = 4; static const int script = 45; } diff --git a/lib/view/page/setting/entry.dart b/lib/view/page/setting/entry.dart index 002aacd0e..9c26f15c6 100644 --- a/lib/view/page/setting/entry.dart +++ b/lib/view/page/setting/entry.dart @@ -18,6 +18,7 @@ import 'package:toolbox/data/res/provider.dart'; import 'package:toolbox/data/res/rebuild.dart'; import 'package:toolbox/data/res/store.dart'; import 'package:toolbox/view/widget/expand_tile.dart'; +import 'package:toolbox/view/widget/markdown.dart'; import '../../../core/persistant_store.dart'; import '../../../core/route.dart'; @@ -55,14 +56,15 @@ class _SettingPageState extends State { icon: const Icon(Icons.delete), onPressed: () => context.showRoundDialog( title: Text(l10n.attention), - child: Text(l10n.askContinue( - '${l10n.delete}: **${l10n.all}** ${l10n.setting}', + child: SimpleMarkdown( + data: l10n.askContinue( + '${l10n.delete} **${l10n.all}** ${l10n.setting}', )), actions: [ TextButton( onPressed: () { - _setting.box.deleteAll(_setting.box.keys); context.pop(); + _setting.box.deleteAll(_setting.box.keys); context.showSnackBar(l10n.success); }, child: Text( @@ -114,6 +116,7 @@ class _SettingPageState extends State { } Widget _buildApp() { + final specific = _buildPlatformSetting(); final children = [ _buildLocale(), _buildThemeMode(), @@ -122,7 +125,7 @@ class _SettingPageState extends State { _buildCheckUpdate(), /// Platform specific settings - if (OS.hasSpecSetting) _buildPlatformSetting(), + if (specific != null) specific, _buildAppMore(), ]; @@ -915,22 +918,17 @@ class _SettingPageState extends State { ); } - Widget _buildPlatformSetting() { + Widget? _buildPlatformSetting() { + final func = switch (OS.type) { + OS.android => AppRoute.androidSettings().go, + OS.ios => AppRoute.iosSettings().go, + _ => null, + }; + if (func == null) return null; return ListTile( title: Text('${OS.type} ${l10n.setting}'), trailing: const Icon(Icons.keyboard_arrow_right), - onTap: () { - switch (OS.type) { - case OS.android: - AppRoute.androidSettings().go(context); - break; - case OS.ios: - AppRoute.iosSettings().go(context); - break; - default: - break; - } - }, + onTap: () => func(context), ); } diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 471b547ad..2bece36df 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -471,7 +471,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -481,7 +481,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -608,7 +608,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Server Box"; @@ -618,7 +618,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -638,7 +638,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 871; + CURRENT_PROJECT_VERSION = 872; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = BA88US33G6; INFOPLIST_FILE = Runner/Info.plist; @@ -649,7 +649,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 1.0.871; + MARKETING_VERSION = 1.0.872; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "Server Box"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/pubspec.lock b/pubspec.lock index 2dbdd0228..b4574a3bb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1370,8 +1370,8 @@ packages: dependency: "direct main" description: path: "." - ref: "7d3c3e2" - resolved-ref: "7d3c3e2c121dae735f4d84de28105427d480c0cf" + ref: a343bc2fdc11fbc7dbfc1f170692426a6fe01cb9 + resolved-ref: a343bc2fdc11fbc7dbfc1f170692426a6fe01cb9 url: "https://github.com/lollipopkit/xterm.dart" source: git version: "4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8a1cd2f7d..2307fedaa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,7 +41,7 @@ dependencies: xterm: # path: ../xterm.dart git: - ref: 7d3c3e2 + ref: a343bc2fdc11fbc7dbfc1f170692426a6fe01cb9 url: https://github.com/lollipopkit/xterm.dart file_picker: ^8.0.1 plain_notification_token: ^0.0.4