添加再次更新时间

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