diff --git a/lib/upgrade_auxiliary_utils.dart b/lib/upgrade_auxiliary_utils.dart index 42a8e52..f7372a5 100644 --- a/lib/upgrade_auxiliary_utils.dart +++ b/lib/upgrade_auxiliary_utils.dart @@ -38,10 +38,14 @@ class UpgradeAuxiliaryUtils { static UpgradeAuxiliaryUtils get instance => _instance; /// 启动版本检查 + /// reUpdateLater 是否恢复重新更新 + /// resetTimeMinute 重置时间 默认30分钟 Future initiateVersionCheck( BuildContext context, { required Future 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),