diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n.dart b/.dart_tool/flutter_gen/gen_l10n/l10n.dart index 0c487b3c..f25e29ad 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n.dart @@ -168,7 +168,7 @@ abstract class S { /// No description provided for @backupTip. /// /// In en, this message translates to: - /// **'The exported data is simply encrypted. \nPlease keep it safe.\nRestoring will not overwrite existing data.'** + /// **'The exported data is simply encrypted. \nPlease keep it safe.'** String get backupTip; /// No description provided for @backupVersionNotMatch. diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart b/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart index 7bd0d944..2cb8a019 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n_en.dart @@ -41,7 +41,7 @@ class SEn extends S { String get backupAndRestore => 'Backup and Restore'; @override - String get backupTip => 'The exported data is simply encrypted. \nPlease keep it safe.\nRestoring will not overwrite existing data.'; + String get backupTip => 'The exported data is simply encrypted. \nPlease keep it safe.'; @override String get backupVersionNotMatch => 'Backup version is not match.'; diff --git a/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart b/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart index 9c013aa8..d70c4af4 100644 --- a/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart +++ b/.dart_tool/flutter_gen/gen_l10n/l10n_zh.dart @@ -41,7 +41,7 @@ class SZh extends S { String get backupAndRestore => '备份和恢复'; @override - String get backupTip => '导出的数据仅进行了简单加密,请妥善保管。\n恢复的数据不会覆盖现有数据。'; + String get backupTip => '导出的数据仅进行了简单加密,请妥善保管。'; @override String get backupVersionNotMatch => '备份版本不匹配,无法恢复'; diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1c21debb..8b4016f4 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 = 263; + CURRENT_PROJECT_VERSION = 268; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -367,7 +367,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.263; + MARKETING_VERSION = 1.0.268; 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 = 263; + CURRENT_PROJECT_VERSION = 268; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -498,7 +498,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.263; + MARKETING_VERSION = 1.0.268; 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 = 263; + CURRENT_PROJECT_VERSION = 268; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -523,7 +523,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.263; + MARKETING_VERSION = 1.0.268; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/core/update.dart b/lib/core/update.dart index 26c8886b..032a5340 100644 --- a/lib/core/update.dart +++ b/lib/core/update.dart @@ -67,7 +67,7 @@ Future doUpdate(BuildContext context, {bool force = false}) async { showSnackBarWithAction( context, - '${s.updateTip(newest)} \n${update.changelog}', + '${s.updateTip(newest)} \n${update.changelog.current}', s.update, () => _doUpdate(url, context, s), ); diff --git a/lib/core/utils/misc.dart b/lib/core/utils/misc.dart index 5dd2c092..de4cd0fa 100644 --- a/lib/core/utils/misc.dart +++ b/lib/core/utils/misc.dart @@ -6,9 +6,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:plain_notification_token/plain_notification_token.dart'; import 'package:share_plus/share_plus.dart'; -import 'package:toolbox/data/provider/app.dart'; -import 'package:toolbox/locator.dart'; +import '../../data/provider/app.dart'; +import '../../locator.dart'; import '../../view/widget/rebuild.dart'; import 'platform.dart'; diff --git a/lib/core/utils/navigator.dart b/lib/core/utils/navigator.dart new file mode 100644 index 00000000..34a46071 --- /dev/null +++ b/lib/core/utils/navigator.dart @@ -0,0 +1,8 @@ +import 'package:flutter/material.dart'; + + +extension ContextX on BuildContext { + void pop([T? result]) { + Navigator.of(this).pop(T); +} +} diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 2e57d392..dcc24e41 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 = 263; + static const int build = 268; static const String engine = "3.7.11"; - static const String buildAt = "2023-04-18 22:01:22.468457"; - static const int modifications = 3; + static const String buildAt = "2023-04-19 20:26:15.641670"; + static const int modifications = 4; } diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 33e3a438..51ce94b1 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -11,7 +11,7 @@ "backDir": "Back", "backup": "Backup", "backupAndRestore": "Backup and Restore", - "backupTip": "The exported data is simply encrypted. \nPlease keep it safe.\nRestoring will not overwrite existing data.", + "backupTip": "The exported data is simply encrypted. \nPlease keep it safe.", "backupVersionNotMatch": "Backup version is not match.", "bgRun": "Run in backgroud", "cancel": "Cancel", diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index fb0b0597..6aab4fd8 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -11,7 +11,7 @@ "backDir": "返回上一级", "backup": "备份", "backupAndRestore": "备份和恢复", - "backupTip": "导出的数据仅进行了简单加密,请妥善保管。\n恢复的数据不会覆盖现有数据。", + "backupTip": "导出的数据仅进行了简单加密,请妥善保管。", "backupVersionNotMatch": "备份版本不匹配,无法恢复", "bgRun": "后台运行", "cancel": "取消", diff --git a/lib/view/page/backup.dart b/lib/view/page/backup.dart index fb253e54..67f4b607 100644 --- a/lib/view/page/backup.dart +++ b/lib/view/page/backup.dart @@ -128,8 +128,7 @@ class BackupPage extends StatelessWidget { showSnackBar(context, Text(s.fieldMustNotEmpty)); return; } - _importBackup(text, context, s); - Navigator.of(context).pop(); + await _importBackup(text, context, s); } Future _importBackup(String raw, BuildContext context, S s) async { @@ -163,12 +162,20 @@ class BackupPage extends StatelessWidget { for (final k in backup.dockerHosts.keys) { _dockerHosts.setDockerHost(k, backup.dockerHosts[k]!); } - Navigator.of(context).pop(); - showSnackBarWithAction( + showRoundDialog( context, - s.restoreSuccess, - s.restart, - () => rebuildAll(context), + s.attention, + Text(s.restoreSuccess), + [ + TextButton( + onPressed: () => rebuildAll(context), + child: Text(s.restart), + ), + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: Text(s.cancel), + ), + ], ); }, child: Text(s.ok),