添加再次更新时间
This commit is contained in:
parent
bcfed6f7c1
commit
704a300896
|
|
@ -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分钟 后重置,可以重新弹出
|
||||
if (reUpdateLater) {
|
||||
_updateLaterTimer?.cancel();
|
||||
_updateLaterTimer = Timer(Duration(seconds: 60 * 30), () {
|
||||
_updateLaterTimer = Timer(Duration(seconds: 60 * resetTimeMinute), () {
|
||||
_updateLater = false;
|
||||
});
|
||||
|
||||
}
|
||||
onUpdateLater?.call();
|
||||
},
|
||||
config: config ?? (kDebugMode ? UpgradeConfig.development : UpgradeConfig.production),
|
||||
|
|
|
|||
Loading…
Reference in New Issue