mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
#77 new: also when backing app
This commit is contained in:
@@ -156,6 +156,12 @@ abstract class S {
|
||||
/// **'Auto'**
|
||||
String get auto;
|
||||
|
||||
/// No description provided for @autoUpdateHomeWidget.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Auto update home widget'**
|
||||
String get autoUpdateHomeWidget;
|
||||
|
||||
/// No description provided for @backup.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
@@ -1320,6 +1326,12 @@ abstract class S {
|
||||
/// **'Please wait for the connection to be established.'**
|
||||
String get waitConnection;
|
||||
|
||||
/// No description provided for @whenOpenApp.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'When opening the app'**
|
||||
String get whenOpenApp;
|
||||
|
||||
/// No description provided for @willTakEeffectImmediately.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
||||
@@ -34,6 +34,9 @@ class SDe extends S {
|
||||
@override
|
||||
String get auto => 'System folgen';
|
||||
|
||||
@override
|
||||
String get autoUpdateHomeWidget => 'Home-Widget automatisch aktualisieren';
|
||||
|
||||
@override
|
||||
String get backup => 'Backup';
|
||||
|
||||
@@ -660,6 +663,9 @@ class SDe extends S {
|
||||
@override
|
||||
String get waitConnection => 'Bitte warte, bis die Verbindung hergestellt wurde.';
|
||||
|
||||
@override
|
||||
String get whenOpenApp => 'Beim Öffnen der App';
|
||||
|
||||
@override
|
||||
String get willTakEeffectImmediately => 'Wird sofort angewendet';
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ class SEn extends S {
|
||||
@override
|
||||
String get auto => 'Auto';
|
||||
|
||||
@override
|
||||
String get autoUpdateHomeWidget => 'Auto update home widget';
|
||||
|
||||
@override
|
||||
String get backup => 'Backup';
|
||||
|
||||
@@ -660,6 +663,9 @@ class SEn extends S {
|
||||
@override
|
||||
String get waitConnection => 'Please wait for the connection to be established.';
|
||||
|
||||
@override
|
||||
String get whenOpenApp => 'When opening the app';
|
||||
|
||||
@override
|
||||
String get willTakEeffectImmediately => 'Will take effect immediately';
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ class SZh extends S {
|
||||
@override
|
||||
String get auto => '自动';
|
||||
|
||||
@override
|
||||
String get autoUpdateHomeWidget => '自动更新桌面小部件';
|
||||
|
||||
@override
|
||||
String get backup => '备份';
|
||||
|
||||
@@ -660,6 +663,9 @@ class SZh extends S {
|
||||
@override
|
||||
String get waitConnection => '请等待连接建立';
|
||||
|
||||
@override
|
||||
String get whenOpenApp => '当打开 App 时';
|
||||
|
||||
@override
|
||||
String get willTakEeffectImmediately => '更改将会立即生效';
|
||||
}
|
||||
@@ -698,6 +704,9 @@ class SZhTw extends SZh {
|
||||
@override
|
||||
String get auto => '自動';
|
||||
|
||||
@override
|
||||
String get autoUpdateHomeWidget => '自動更新桌面小部件';
|
||||
|
||||
@override
|
||||
String get backup => '備份';
|
||||
|
||||
@@ -1324,6 +1333,9 @@ class SZhTw extends SZh {
|
||||
@override
|
||||
String get waitConnection => '請等待連接建立';
|
||||
|
||||
@override
|
||||
String get whenOpenApp => '當打開 App 時';
|
||||
|
||||
@override
|
||||
String get willTakEeffectImmediately => '更改將會立即生效';
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -478,7 +478,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -602,7 +602,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -610,7 +610,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -628,7 +628,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||
@@ -636,7 +636,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -657,7 +657,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -670,7 +670,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||
@@ -696,7 +696,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -709,7 +709,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@@ -732,7 +732,7 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@@ -745,7 +745,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
||||
@@ -9,9 +9,17 @@ import Flutter
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
if #available(iOS 14.0, *) {
|
||||
|
||||
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController
|
||||
let methodChannel = FlutterMethodChannel(name: "tech.lolli.toolbox/home_widget", binaryMessenger: controller.binaryMessenger)
|
||||
methodChannel.setMethodCallHandler({
|
||||
(call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
|
||||
if call.method == "update" {
|
||||
if #available(iOS 14.0, *) {
|
||||
WidgetCenter.shared.reloadTimelines(ofKind: "StatusWidget")
|
||||
}
|
||||
}
|
||||
})
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 380;
|
||||
static const int build = 387;
|
||||
static const String engine = "3.10.6";
|
||||
static const String buildAt = "2023-07-20 18:08:32.806339";
|
||||
static const int modifications = 14;
|
||||
static const String buildAt = "2023-07-21 18:06:24.239059";
|
||||
static const int modifications = 2;
|
||||
}
|
||||
|
||||
@@ -15,3 +15,4 @@ const maxDebugLogLines = 100;
|
||||
/// Method Channels
|
||||
const pkgName = 'tech.lolli.toolbox';
|
||||
const bgRunChannel = MethodChannel('$pkgName/app_retain');
|
||||
const homeWidgetChannel = MethodChannel('$pkgName/home_widget');
|
||||
|
||||
@@ -95,4 +95,7 @@ class SettingStore extends PersistentStore {
|
||||
|
||||
StoreProperty<NetViewType> get netViewType =>
|
||||
property('netViewType', defaultValue: NetViewType.speed);
|
||||
|
||||
// Only valid on iOS
|
||||
StoreProperty<bool> get autoUpdateHomeWidget => property('autoUpdateHomeWidget', defaultValue: isIOS);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"alreadyLastDir": "Bereits im letzten Verzeichnis.",
|
||||
"attention": "Achtung",
|
||||
"auto": "System folgen",
|
||||
"autoUpdateHomeWidget": "Home-Widget automatisch aktualisieren",
|
||||
"backup": "Backup",
|
||||
"backupAndRestore": "Backup und Wiederherstellung",
|
||||
"backupTip": "Das Backup wird nur einfach verschlüsselt.\nBitte bewahre die Datei sicher auf.",
|
||||
@@ -204,5 +205,6 @@
|
||||
"versionUpdated": "v1.0.{build} ist bereits die neueste Version",
|
||||
"viewErr": "Fehler anzeigen",
|
||||
"waitConnection": "Bitte warte, bis die Verbindung hergestellt wurde.",
|
||||
"whenOpenApp": "Beim Öffnen der App",
|
||||
"willTakEeffectImmediately": "Wird sofort angewendet"
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
"alreadyLastDir": "Already in last directory.",
|
||||
"attention": "Attention",
|
||||
"auto": "Auto",
|
||||
"autoUpdateHomeWidget": "Auto update home widget",
|
||||
"backup": "Backup",
|
||||
"backupAndRestore": "Backup and Restore",
|
||||
"backupTip": "The exported data is simply encrypted. \nPlease keep it safe.",
|
||||
@@ -204,5 +205,6 @@
|
||||
"versionUpdated": "Current: v1.0.{build}, is up to date",
|
||||
"viewErr": "See error",
|
||||
"waitConnection": "Please wait for the connection to be established.",
|
||||
"whenOpenApp": "When opening the app",
|
||||
"willTakEeffectImmediately": "Will take effect immediately"
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
"alreadyLastDir": "已经是最上层目录了",
|
||||
"attention": "注意",
|
||||
"auto": "自动",
|
||||
"autoUpdateHomeWidget": "自动更新桌面小部件",
|
||||
"backup": "备份",
|
||||
"backupAndRestore": "备份和恢复",
|
||||
"backupTip": "导出的数据仅进行了简单加密,请妥善保管。",
|
||||
@@ -204,5 +205,6 @@
|
||||
"versionUpdated": "当前:v1.0.{build}, 已是最新版本",
|
||||
"viewErr": "查看错误",
|
||||
"waitConnection": "请等待连接建立",
|
||||
"whenOpenApp": "当打开 App 时",
|
||||
"willTakEeffectImmediately": "更改将会立即生效"
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
"alreadyLastDir": "已經是最上層目錄了",
|
||||
"attention": "注意",
|
||||
"auto": "自動",
|
||||
"autoUpdateHomeWidget": "自動更新桌面小部件",
|
||||
"backup": "備份",
|
||||
"backupAndRestore": "備份和還原",
|
||||
"backupTip": "導出的數據僅進行了簡單加密,請妥善保管。",
|
||||
@@ -204,5 +205,6 @@
|
||||
"versionUpdated": "當前:v1.0.{build}, 已是最新版本",
|
||||
"viewErr": "查看錯誤",
|
||||
"waitConnection": "請等待連接建立",
|
||||
"whenOpenApp": "當打開 App 時",
|
||||
"willTakEeffectImmediately": "更改將會立即生效"
|
||||
}
|
||||
@@ -85,6 +85,7 @@ class _HomePageState extends State<HomePage>
|
||||
if (!_serverProvider.isAutoRefreshOn) {
|
||||
_serverProvider.startAutoRefresh();
|
||||
}
|
||||
updateHomeWidget();
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
// Keep running in background on Android device
|
||||
@@ -306,6 +307,7 @@ class _HomePageState extends State<HomePage>
|
||||
@override
|
||||
Future<void> afterFirstLayout(BuildContext context) async {
|
||||
doUpdate(context);
|
||||
updateHomeWidget();
|
||||
await GetIt.I.allReady();
|
||||
await _serverProvider.loadLocalData();
|
||||
await _serverProvider.refreshData();
|
||||
@@ -313,4 +315,10 @@ class _HomePageState extends State<HomePage>
|
||||
Analysis.init();
|
||||
}
|
||||
}
|
||||
|
||||
void updateHomeWidget() {
|
||||
if (_setting.autoUpdateHomeWidget.fetch()!) {
|
||||
homeWidgetChannel.invokeMethod('update');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
];
|
||||
if (isIOS) {
|
||||
children.add(_buildPushToken());
|
||||
children.add(_buildAutoUpdateHomeWidget());
|
||||
}
|
||||
if (isAndroid) {
|
||||
children.add(_buildBgRun());
|
||||
@@ -928,4 +929,12 @@ class _SettingPageState extends State<SettingPage> {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAutoUpdateHomeWidget() {
|
||||
return ListTile(
|
||||
title: Text(_s.autoUpdateHomeWidget),
|
||||
subtitle: Text(_s.whenOpenApp, style: grey),
|
||||
trailing: buildSwitch(context, _setting.autoUpdateHomeWidget),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ PODS:
|
||||
- FlutterMacOS
|
||||
- share_plus (0.0.1):
|
||||
- FlutterMacOS
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- url_launcher_macos (0.0.1):
|
||||
- FlutterMacOS
|
||||
|
||||
@@ -15,6 +18,7 @@ DEPENDENCIES:
|
||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
|
||||
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
@@ -26,14 +30,17 @@ EXTERNAL SOURCES:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
|
||||
share_plus:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
|
||||
shared_preferences_foundation:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
|
||||
url_launcher_macos:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
flutter_volume_controller: 25d09126b0d695560f11c80b1311d5063fed882f
|
||||
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
|
||||
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
|
||||
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
|
||||
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
|
||||
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||
url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451
|
||||
|
||||
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
|
||||
|
||||
@@ -475,9 +475,9 @@
|
||||
baseConfigurationReference = C1C758C41C4E208965A68933 /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CURRENT_PROJECT_VERSION = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
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 = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
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 = 380;
|
||||
CURRENT_PROJECT_VERSION = 387;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
MARKETING_VERSION = 1.0.380;
|
||||
MARKETING_VERSION = 1.0.387;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = tech.lolli.serverBox.RunnerTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
Reference in New Issue
Block a user