From 704a30089645b8c8a97d7a2cd4e47d747795588c Mon Sep 17 00:00:00 2001 From: "DESKTOP-I3JPKHK\\wy" <1111> Date: Sat, 20 Dec 2025 11:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=86=8D=E6=AC=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/upgrade_auxiliary_utils.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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),