添加再次更新时间

This commit is contained in:
DESKTOP-I3JPKHK\wy 2025-12-20 11:27:31 +08:00
parent bcfed6f7c1
commit 704a300896
1 changed files with 10 additions and 5 deletions

View File

@ -38,10 +38,14 @@ class UpgradeAuxiliaryUtils {
static UpgradeAuxiliaryUtils get instance => _instance; static UpgradeAuxiliaryUtils get instance => _instance;
/// ///
/// reUpdateLater
/// resetTimeMinute 30
Future<void> initiateVersionCheck( Future<void> initiateVersionCheck(
BuildContext context, { BuildContext context, {
required Future<AppUpgradeVersion?> Function(int upType) future, required Future<AppUpgradeVersion?> Function(int upType) future,
UpgradeConfig? config, UpgradeConfig? config,
bool reUpdateLater = true,
int resetTimeMinute = 30,
bool? showNoUpdateToast, bool? showNoUpdateToast,
bool? autoInstall, bool? autoInstall,
VoidCallback? onComplete, VoidCallback? onComplete,
@ -77,11 +81,12 @@ class UpgradeAuxiliaryUtils {
_updateLater = true; _updateLater = true;
/// 30 /// 30
_updateLaterTimer?.cancel(); if (reUpdateLater) {
_updateLaterTimer = Timer(Duration(seconds: 60 * 30), () { _updateLaterTimer?.cancel();
_updateLater = false; _updateLaterTimer = Timer(Duration(seconds: 60 * resetTimeMinute), () {
}); _updateLater = false;
});
}
onUpdateLater?.call(); onUpdateLater?.call();
}, },
config: config ?? (kDebugMode ? UpgradeConfig.development : UpgradeConfig.production), config: config ?? (kDebugMode ? UpgradeConfig.development : UpgradeConfig.production),