diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n.dart b/.dart_tool/flutter_gen/gen_l10n/l10n.dart index 464abdc8..0c487b3c 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n.dart @@ -612,7 +612,7 @@ abstract class S { /// No description provided for @madeWithLove. /// /// In en, this message translates to: - /// **'\nMade with ❤️ by {myGithub}'** + /// **'Made with ❤️ by {myGithub}'** String madeWithLove(Object myGithub); /// No description provided for @max. diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart b/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart index 0a0359d0..7bd0d944 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart @@ -284,7 +284,7 @@ class SEn extends S { @override String madeWithLove(Object myGithub) { - return '\nMade with ❤️ by $myGithub'; + return 'Made with ❤️ by $myGithub'; } @override diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart b/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart index 6f05ef02..9c013aa8 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart @@ -284,7 +284,7 @@ class SZh extends S { @override String madeWithLove(Object myGithub) { - return '\n用❤️制作 by $myGithub'; + return '用❤️制作 by $myGithub'; } @override diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 50efb55f..1c21debb 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -359,7 +359,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 262; + CURRENT_PROJECT_VERSION = 263; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -367,7 +367,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.262; + MARKETING_VERSION = 1.0.263; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -490,7 +490,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 262; + CURRENT_PROJECT_VERSION = 263; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -498,7 +498,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.262; + MARKETING_VERSION = 1.0.263; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -515,7 +515,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 262; + CURRENT_PROJECT_VERSION = 263; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -523,7 +523,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.262; + MARKETING_VERSION = 1.0.263; 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/update.dart b/lib/data/model/app/update.dart index bc31458c..01a8d592 100644 --- a/lib/data/model/app/update.dart +++ b/lib/data/model/app/update.dart @@ -30,94 +30,97 @@ import 'dart:convert'; import '/core/utils/platform.dart'; class AppUpdate { - AppUpdate({ - required this.changelog, - required this.build, - required this.url, - }); + AppUpdate({ + required this.changelog, + required this.build, + required this.url, + }); - final AppUpdatePlatformSpecific changelog; - final Build build; - final AppUpdatePlatformSpecific url; + final AppUpdatePlatformSpecific changelog; + final Build build; + final AppUpdatePlatformSpecific url; - factory AppUpdate.fromRawJson(String str) => AppUpdate.fromJson(json.decode(str)); + factory AppUpdate.fromRawJson(String str) => + AppUpdate.fromJson(json.decode(str)); - String toRawJson() => json.encode(toJson()); + String toRawJson() => json.encode(toJson()); - factory AppUpdate.fromJson(Map json) => AppUpdate( + factory AppUpdate.fromJson(Map json) => AppUpdate( changelog: AppUpdatePlatformSpecific.fromJson(json["changelog"]), build: Build.fromJson(json["build"]), url: AppUpdatePlatformSpecific.fromJson(json["url"]), - ); + ); - Map toJson() => { + Map toJson() => { "changelog": changelog.toJson(), "build": build.toJson(), "url": url.toJson(), - }; + }; } class Build { - Build({ - required this.min, - required this.last, - }); + Build({ + required this.min, + required this.last, + }); - final AppUpdatePlatformSpecific min; - final AppUpdatePlatformSpecific last; + final AppUpdatePlatformSpecific min; + final AppUpdatePlatformSpecific last; - factory Build.fromRawJson(String str) => Build.fromJson(json.decode(str)); + factory Build.fromRawJson(String str) => Build.fromJson(json.decode(str)); - String toRawJson() => json.encode(toJson()); + String toRawJson() => json.encode(toJson()); - factory Build.fromJson(Map json) => Build( + factory Build.fromJson(Map json) => Build( min: AppUpdatePlatformSpecific.fromJson(json["min"]), last: AppUpdatePlatformSpecific.fromJson(json["last"]), - ); + ); - Map toJson() => { + Map toJson() => { "min": min.toJson(), "last": last.toJson(), - }; + }; } class AppUpdatePlatformSpecific { - AppUpdatePlatformSpecific({ - required this.mac, - required this.ios, - required this.android, - }); + AppUpdatePlatformSpecific({ + required this.mac, + required this.ios, + required this.android, + }); - final T mac; - final T ios; - final T android; + final T mac; + final T ios; + final T android; - factory AppUpdatePlatformSpecific.fromRawJson(String str) => AppUpdatePlatformSpecific.fromJson(json.decode(str)); + factory AppUpdatePlatformSpecific.fromRawJson(String str) => + AppUpdatePlatformSpecific.fromJson(json.decode(str)); - String toRawJson() => json.encode(toJson()); + String toRawJson() => json.encode(toJson()); - factory AppUpdatePlatformSpecific.fromJson(Map json) => AppUpdatePlatformSpecific( + factory AppUpdatePlatformSpecific.fromJson(Map json) => + AppUpdatePlatformSpecific( mac: json["mac"], ios: json["ios"], android: json["android"], - ); + ); - Map toJson() => { + Map toJson() => { "mac": mac, "ios": ios, "android": android, - }; + }; - T? get current { - switch (platform) { - case PlatformType.macos: - return mac; - case PlatformType.ios: - return ios; - case PlatformType.android: - return android; - default: - return null; - } + T? get current { + switch (platform) { + case PlatformType.macos: + return mac; + case PlatformType.ios: + return ios; + case PlatformType.android: + return android; + default: + return null; } + } } diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 7bce6fb3..2e57d392 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,8 +2,8 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 262; + static const int build = 263; static const String engine = "3.7.11"; - static const String buildAt = "2023-04-17 18:13:48.223240"; - static const int modifications = 4; + static const String buildAt = "2023-04-18 22:01:22.468457"; + static const int modifications = 3; } diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index ac16761c..33e3a438 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -85,7 +85,7 @@ "light": "Light", "loadingFiles": "Loading files...", "loss": "loss", - "madeWithLove": "\nMade with ❤️ by {myGithub}", + "madeWithLove": "Made with ❤️ by {myGithub}", "max": "max", "maxRetryCount": "Number of server reconnection", "maxRetryCountEqual0": "Will retry again and again.", diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 8afd4194..fb0b0597 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -85,7 +85,7 @@ "light": "亮", "loadingFiles": "正在加载目录。。。", "loss": "丢包率", - "madeWithLove": "\n用❤️制作 by {myGithub}", + "madeWithLove": "用❤️制作 by {myGithub}", "max": "最大", "maxRetryCount": "服务器尝试重连次数", "maxRetryCountEqual0": "会无限重试", diff --git a/lib/view/page/home.dart b/lib/view/page/home.dart index 788f3b14..b07f91b6 100644 --- a/lib/view/page/home.dart +++ b/lib/view/page/home.dart @@ -265,27 +265,44 @@ class _MyHomePageState extends State onTap: () => AppRoute(const SnippetListPage(), 'snippet list') .go(context), ), - AboutListTile( - icon: const Icon(Icons.text_snippet), - applicationName: '\n${BuildData.name}', - applicationVersion: _versionStr, - applicationIcon: _buildIcon(), - aboutBoxChildren: [ - UrlText( - text: _s.madeWithLove(myGithub), - replace: 'lollipopkit'), - UrlText( - text: _s.aboutThanks, - ), - // Thanks - ...thanksMap.keys.map( - (key) => UrlText( - text: thanksMap[key] ?? '', - replace: key, + ListTile( + leading: const Icon(Icons.text_snippet), + title: Text(_s.about), + onTap: () { + showRoundDialog( + context, + _s.about, + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + UrlText( + text: _s.madeWithLove(myGithub), + replace: 'lollipopkit'), + UrlText( + text: _s.aboutThanks, + ), + // Thanks + ...thanksMap.keys.map( + (key) => UrlText( + text: thanksMap[key] ?? '', + replace: key, + ), + ) + ], ), - ) - ], - child: Text(_s.about), + [ + TextButton( + onPressed: () => showLicensePage(context: context), + child: Text(_s.license), + ), + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(_s.close), + ) + ], + ); + }, ) ], ),