fix: import backup

This commit is contained in:
lollipopkit
2023-08-01 13:41:00 +08:00
parent 0f83d10bfa
commit 33932f7428
9 changed files with 26 additions and 34 deletions

View File

@@ -6,8 +6,6 @@ PODS:
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_native_splash (0.0.1): - flutter_native_splash (0.0.1):
- Flutter - Flutter
- flutter_volume_controller (0.0.1):
- Flutter
- path_provider_foundation (0.0.1): - path_provider_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
@@ -28,7 +26,6 @@ DEPENDENCIES:
- file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - 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`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- plain_notification_token (from `.symlinks/plugins/plain_notification_token/ios`) - plain_notification_token (from `.symlinks/plugins/plain_notification_token/ios`)
- r_upgrade (from `.symlinks/plugins/r_upgrade/ios`) - r_upgrade (from `.symlinks/plugins/r_upgrade/ios`)
@@ -45,8 +42,6 @@ EXTERNAL SOURCES:
:path: Flutter :path: Flutter
flutter_native_splash: flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios" :path: ".symlinks/plugins/flutter_native_splash/ios"
flutter_volume_controller:
:path: ".symlinks/plugins/flutter_volume_controller/ios"
path_provider_foundation: path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
plain_notification_token: plain_notification_token:
@@ -65,7 +60,6 @@ SPEC CHECKSUMS:
file_picker: 1d63c4949e05e386da864365f8c13e1e64787675 file_picker: 1d63c4949e05e386da864365f8c13e1e64787675
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
flutter_volume_controller: e4d5832f08008180f76e30faf671ffd5a425e529
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8 path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
plain_notification_token: b36467dc91939a7b6754267c701bbaca14996ee1 plain_notification_token: b36467dc91939a7b6754267c701bbaca14996ee1
r_upgrade: 44d715c61914cce3d01ea225abffe894fd51c114 r_upgrade: 44d715c61914cce3d01ea225abffe894fd51c114

View File

@@ -4,4 +4,6 @@ extension ContextX on BuildContext {
void pop<T extends Object?>([T? result]) { void pop<T extends Object?>([T? result]) {
Navigator.of(this).pop<T>(result); Navigator.of(this).pop<T>(result);
} }
bool get canPop => Navigator.of(this).canPop();
} }

View File

@@ -26,10 +26,10 @@ Future<bool> shareFiles(BuildContext context, List<String> filePaths) async {
} else { } else {
text = '${filePaths.length} ${S.of(context)!.files}'; text = '${filePaths.length} ${S.of(context)!.files}';
} }
_app.setCanMoveBg(false); _app.moveBg = false;
// ignore: deprecated_member_use // ignore: deprecated_member_use
await Share.shareFiles(filePaths, subject: 'ServerBox -> $text'); await Share.shareFiles(filePaths, subject: 'ServerBox -> $text');
_app.setCanMoveBg(true); _app.moveBg = true;
return filePaths.isNotEmpty; return filePaths.isNotEmpty;
} }
@@ -38,9 +38,9 @@ void copy2Clipboard(String text) {
} }
Future<String?> pickOneFile() async { Future<String?> pickOneFile() async {
_app.setCanMoveBg(false); _app.moveBg = false;
final result = await FilePicker.platform.pickFiles(type: FileType.any); final result = await FilePicker.platform.pickFiles(type: FileType.any);
_app.setCanMoveBg(true); _app.moveBg = true;
return result?.files.single.path; return result?.files.single.path;
} }

View File

@@ -39,13 +39,13 @@ class ServerPrivateInfo {
ServerPrivateInfo.fromJson(Map<String, dynamic> json) { ServerPrivateInfo.fromJson(Map<String, dynamic> json) {
name = json["name"].toString(); name = json["name"].toString();
ip = json["ip"].toString(); ip = json["ip"].toString();
port = int.tryParse(json["port"]) ?? 22; port = json["port"] ?? 22;
user = json["user"].toString(); user = json["user"].toString();
pwd = json["authorization"].toString(); pwd = json["authorization"].toString();
pubKeyId = json["pubKeyId"]?.toString(); pubKeyId = json["pubKeyId"]?.toString();
id = '$user@$ip:$port'; id = '$user@$ip:$port';
tags = json["tags"]?.cast<String>(); tags = json["tags"]?.cast<String>();
alterUrl = json["alterHost"]?.toString(); alterUrl = json["alterUrl"]?.toString();
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -57,7 +57,7 @@ class ServerPrivateInfo {
data["authorization"] = pwd; data["authorization"] = pwd;
data["pubKeyId"] = pubKeyId; data["pubKeyId"] = pubKeyId;
data["tags"] = tags; data["tags"] = tags;
data["alterHost"] = alterUrl; data["alterUrl"] = alterUrl;
return data; return data;
} }

View File

@@ -4,15 +4,10 @@ class AppProvider extends BusyProvider {
int? _newestBuild; int? _newestBuild;
int? get newestBuild => _newestBuild; int? get newestBuild => _newestBuild;
bool _moveBg = true; bool moveBg = true;
bool get moveBg => _moveBg;
void setNewestBuild(int build) { void setNewestBuild(int build) {
_newestBuild = build; _newestBuild = build;
notifyListeners(); notifyListeners();
} }
void setCanMoveBg(bool moveBg) {
_moveBg = moveBg;
}
} }

View File

@@ -2,8 +2,8 @@
class BuildData { class BuildData {
static const String name = "ServerBox"; 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 engine = "3.10.6";
static const String buildAt = "2023-07-28 20:51:35.807892"; static const String buildAt = "2023-07-31 14:06:15.008140";
static const int modifications = 6; static const int modifications = 9;
} }

View File

@@ -41,6 +41,7 @@ class _HomePageState extends State<HomePage>
WidgetsBindingObserver { WidgetsBindingObserver {
final _serverProvider = locator<ServerProvider>(); final _serverProvider = locator<ServerProvider>();
final _setting = locator<SettingStore>(); final _setting = locator<SettingStore>();
final _app = locator<AppProvider>();
late final PageController _pageController; late final PageController _pageController;
@@ -90,7 +91,7 @@ class _HomePageState extends State<HomePage>
case AppLifecycleState.paused: case AppLifecycleState.paused:
// Keep running in background on Android device // Keep running in background on Android device
if (isAndroid && _setting.bgRun.fetch()!) { if (isAndroid && _setting.bgRun.fetch()!) {
if (locator<AppProvider>().moveBg) { if (_app.moveBg) {
bgRunChannel.invokeMethod('sendToBackground'); bgRunChannel.invokeMethod('sendToBackground');
} }
} else { } else {

View File

@@ -290,11 +290,11 @@ class _SftpPageState extends State<SftpPage> {
title: Text(file.filename), title: Text(file.filename),
trailing: trailing, trailing: trailing,
subtitle: isDir subtitle: isDir
? null ? null
: Text( : Text(
(file.attr.size ?? 0).convertBytes, (file.attr.size ?? 0).convertBytes,
style: grey, style: grey,
), ),
onTap: () { onTap: () {
if (isDir) { if (isDir) {
_status.path?.update(file.filename); _status.path?.update(file.filename);

View File

@@ -475,9 +475,9 @@
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */; baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 397; CURRENT_PROJECT_VERSION = 400;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.397; MARKETING_VERSION = 1.0.400;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -490,9 +490,9 @@
baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */; baseConfigurationReference = 15AF97DF993E8968098D6EBE /* Pods-RunnerTests.release.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 397; CURRENT_PROJECT_VERSION = 400;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.397; MARKETING_VERSION = 1.0.400;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@@ -505,9 +505,9 @@
baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */; baseConfigurationReference = 7CFA7DE7FABA75685DFB6948 /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CURRENT_PROJECT_VERSION = 397; CURRENT_PROJECT_VERSION = 400;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.397; MARKETING_VERSION = 1.0.400;
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;