diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1feeaed0..a1d6006d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -6,8 +6,6 @@ PODS: - Flutter (1.0.0) - flutter_native_splash (0.0.1): - Flutter - - flutter_volume_controller (0.0.1): - - Flutter - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS @@ -28,7 +26,6 @@ DEPENDENCIES: - file_picker (from `.symlinks/plugins/file_picker/ios`) - Flutter (from `Flutter`) - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - - flutter_volume_controller (from `.symlinks/plugins/flutter_volume_controller/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - plain_notification_token (from `.symlinks/plugins/plain_notification_token/ios`) - r_upgrade (from `.symlinks/plugins/r_upgrade/ios`) @@ -45,8 +42,6 @@ EXTERNAL SOURCES: :path: Flutter flutter_native_splash: :path: ".symlinks/plugins/flutter_native_splash/ios" - flutter_volume_controller: - :path: ".symlinks/plugins/flutter_volume_controller/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" plain_notification_token: @@ -65,7 +60,6 @@ SPEC CHECKSUMS: file_picker: 1d63c4949e05e386da864365f8c13e1e64787675 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef - flutter_volume_controller: e4d5832f08008180f76e30faf671ffd5a425e529 path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 plain_notification_token: b36467dc91939a7b6754267c701bbaca14996ee1 r_upgrade: 44d715c61914cce3d01ea225abffe894fd51c114 diff --git a/lib/core/extension/navigator.dart b/lib/core/extension/navigator.dart index b0ff14e7..c72fa043 100644 --- a/lib/core/extension/navigator.dart +++ b/lib/core/extension/navigator.dart @@ -4,4 +4,6 @@ extension ContextX on BuildContext { void pop([T? result]) { Navigator.of(this).pop(result); } + + bool get canPop => Navigator.of(this).canPop(); } diff --git a/lib/core/utils/misc.dart b/lib/core/utils/misc.dart index e66978de..6d9656af 100644 --- a/lib/core/utils/misc.dart +++ b/lib/core/utils/misc.dart @@ -26,10 +26,10 @@ Future shareFiles(BuildContext context, List filePaths) async { } else { text = '${filePaths.length} ${S.of(context)!.files}'; } - _app.setCanMoveBg(false); + _app.moveBg = false; // ignore: deprecated_member_use await Share.shareFiles(filePaths, subject: 'ServerBox -> $text'); - _app.setCanMoveBg(true); + _app.moveBg = true; return filePaths.isNotEmpty; } @@ -38,9 +38,9 @@ void copy2Clipboard(String text) { } Future pickOneFile() async { - _app.setCanMoveBg(false); + _app.moveBg = false; final result = await FilePicker.platform.pickFiles(type: FileType.any); - _app.setCanMoveBg(true); + _app.moveBg = true; return result?.files.single.path; } diff --git a/lib/data/model/server/server_private_info.dart b/lib/data/model/server/server_private_info.dart index fe0613f7..7cb6a28c 100644 --- a/lib/data/model/server/server_private_info.dart +++ b/lib/data/model/server/server_private_info.dart @@ -39,13 +39,13 @@ class ServerPrivateInfo { ServerPrivateInfo.fromJson(Map json) { name = json["name"].toString(); ip = json["ip"].toString(); - port = int.tryParse(json["port"]) ?? 22; + port = json["port"] ?? 22; user = json["user"].toString(); pwd = json["authorization"].toString(); pubKeyId = json["pubKeyId"]?.toString(); id = '$user@$ip:$port'; tags = json["tags"]?.cast(); - alterUrl = json["alterHost"]?.toString(); + alterUrl = json["alterUrl"]?.toString(); } Map toJson() { @@ -57,7 +57,7 @@ class ServerPrivateInfo { data["authorization"] = pwd; data["pubKeyId"] = pubKeyId; data["tags"] = tags; - data["alterHost"] = alterUrl; + data["alterUrl"] = alterUrl; return data; } diff --git a/lib/data/provider/app.dart b/lib/data/provider/app.dart index 138254d6..7874fda2 100644 --- a/lib/data/provider/app.dart +++ b/lib/data/provider/app.dart @@ -4,15 +4,10 @@ class AppProvider extends BusyProvider { int? _newestBuild; int? get newestBuild => _newestBuild; - bool _moveBg = true; - bool get moveBg => _moveBg; + bool moveBg = true; void setNewestBuild(int build) { _newestBuild = build; notifyListeners(); } - - void setCanMoveBg(bool moveBg) { - _moveBg = moveBg; - } } diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index 4ae107ee..f2b39237 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 = 397; + static const int build = 400; static const String engine = "3.10.6"; - static const String buildAt = "2023-07-28 20:51:35.807892"; - static const int modifications = 6; + static const String buildAt = "2023-07-31 14:06:15.008140"; + static const int modifications = 9; } diff --git a/lib/view/page/home.dart b/lib/view/page/home.dart index a94f866b..95094ba1 100644 --- a/lib/view/page/home.dart +++ b/lib/view/page/home.dart @@ -41,6 +41,7 @@ class _HomePageState extends State WidgetsBindingObserver { final _serverProvider = locator(); final _setting = locator(); + final _app = locator(); late final PageController _pageController; @@ -90,7 +91,7 @@ class _HomePageState extends State case AppLifecycleState.paused: // Keep running in background on Android device if (isAndroid && _setting.bgRun.fetch()!) { - if (locator().moveBg) { + if (_app.moveBg) { bgRunChannel.invokeMethod('sendToBackground'); } } else { diff --git a/lib/view/page/storage/sftp.dart b/lib/view/page/storage/sftp.dart index 2e2fb0c3..7070b5ce 100644 --- a/lib/view/page/storage/sftp.dart +++ b/lib/view/page/storage/sftp.dart @@ -290,11 +290,11 @@ class _SftpPageState extends State { title: Text(file.filename), trailing: trailing, subtitle: isDir - ? null - : Text( - (file.attr.size ?? 0).convertBytes, - style: grey, - ), + ? null + : Text( + (file.attr.size ?? 0).convertBytes, + style: grey, + ), onTap: () { if (isDir) { _status.path?.update(file.filename); diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index d9d5ae90..908a3146 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -475,9 +475,9 @@ baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 397; + CURRENT_PROJECT_VERSION = 400; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.397; + MARKETING_VERSION = 1.0.400; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -490,9 +490,9 @@ baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 397; + CURRENT_PROJECT_VERSION = 400; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.397; + MARKETING_VERSION = 1.0.400; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -505,9 +505,9 @@ baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 397; + CURRENT_PROJECT_VERSION = 400; GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0.397; + MARKETING_VERSION = 1.0.400; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0;