mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
new: VersionRelated
This commit is contained in:
@@ -15,7 +15,9 @@ import 'package:toolbox/core/utils/platform/base.dart';
|
||||
import 'package:toolbox/core/utils/sync/webdav.dart';
|
||||
import 'package:toolbox/core/utils/ui.dart';
|
||||
import 'package:toolbox/data/model/app/menu/server_func.dart';
|
||||
import 'package:toolbox/data/model/app/version_related.dart';
|
||||
import 'package:toolbox/data/model/server/custom.dart';
|
||||
import 'package:toolbox/data/res/build_data.dart';
|
||||
import 'package:toolbox/data/res/logger.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
@@ -102,6 +104,8 @@ Future<void> _initApp() async {
|
||||
if (Stores.setting.icloudSync.fetch()) ICloud.sync();
|
||||
}
|
||||
if (Stores.setting.webdavSync.fetch()) Webdav.sync();
|
||||
|
||||
_doVersionRelated();
|
||||
}
|
||||
|
||||
void _setupProviders() {
|
||||
@@ -149,3 +153,13 @@ Future<void> _initDesktopWindow() async {
|
||||
await windowManager.focus();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _doVersionRelated() async {
|
||||
final curVer = Stores.setting.lastVer.fetch();
|
||||
const newVer = BuildData.build;
|
||||
if (curVer < newVer) {
|
||||
/// Call [Iterable.toList] to consume the lazy iterable.
|
||||
VersionRelated.funcs.map((e) => e(newVer)).toList();
|
||||
Stores.setting.lastVer.put(newVer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user