diff --git a/lib/upgrade_auxiliary_utils.dart b/lib/upgrade_auxiliary_utils.dart index b40f522..42a8e52 100644 --- a/lib/upgrade_auxiliary_utils.dart +++ b/lib/upgrade_auxiliary_utils.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:io'; import 'package:flutter/foundation.dart'; @@ -29,6 +30,8 @@ class UpgradeAuxiliaryUtils { } } + Timer? _updateLaterTimer; + static final UpgradeAuxiliaryUtils _instance = UpgradeAuxiliaryUtils._(); /// 获取 UpgradeService 单例 @@ -72,6 +75,13 @@ class UpgradeAuxiliaryUtils { }, onUpdateLater: () { _updateLater = true; + + /// 30分钟 后重置,可以重新弹出 + _updateLaterTimer?.cancel(); + _updateLaterTimer = Timer(Duration(seconds: 60 * 30), () { + _updateLater = false; + }); + onUpdateLater?.call(); }, config: config ?? (kDebugMode ? UpgradeConfig.development : UpgradeConfig.production),