opt.: icloud sync (#187)

This commit is contained in:
lollipopkit
2023-12-04 10:44:51 +08:00
parent 5035fdce86
commit 3524d92013
9 changed files with 73 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ import 'package:macos_window_utils/window_manipulator.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:toolbox/core/channel/bg_run.dart';
import 'package:toolbox/core/utils/icloud.dart';
import 'package:toolbox/core/utils/platform/base.dart';
import 'package:toolbox/data/res/logger.dart';
import 'package:toolbox/data/res/provider.dart';
@@ -91,6 +92,9 @@ Future<void> initApp() async {
// SharedPreferences is only used on Android for saving home widgets settings.
SharedPreferences.setPrefix('');
}
if (isIOS || isMacOS) {
if (Stores.setting.icloudSync.fetch()) ICloud.sync();
}
}
void _setupProviders() {