添加再次更新时间
This commit is contained in:
parent
bcfed6f7c1
commit
704a300896
|
|
@ -38,10 +38,14 @@ class UpgradeAuxiliaryUtils {
|
||||||
static UpgradeAuxiliaryUtils get instance => _instance;
|
static UpgradeAuxiliaryUtils get instance => _instance;
|
||||||
|
|
||||||
/// 启动版本检查
|
/// 启动版本检查
|
||||||
|
/// reUpdateLater 是否恢复重新更新
|
||||||
|
/// resetTimeMinute 重置时间 默认30分钟
|
||||||
Future<void> initiateVersionCheck(
|
Future<void> initiateVersionCheck(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required Future<AppUpgradeVersion?> Function(int upType) future,
|
required Future<AppUpgradeVersion?> Function(int upType) future,
|
||||||
UpgradeConfig? config,
|
UpgradeConfig? config,
|
||||||
|
bool reUpdateLater = true,
|
||||||
|
int resetTimeMinute = 30,
|
||||||
bool? showNoUpdateToast,
|
bool? showNoUpdateToast,
|
||||||
bool? autoInstall,
|
bool? autoInstall,
|
||||||
VoidCallback? onComplete,
|
VoidCallback? onComplete,
|
||||||
|
|
@ -77,11 +81,12 @@ class UpgradeAuxiliaryUtils {
|
||||||
_updateLater = true;
|
_updateLater = true;
|
||||||
|
|
||||||
/// 30分钟 后重置,可以重新弹出
|
/// 30分钟 后重置,可以重新弹出
|
||||||
_updateLaterTimer?.cancel();
|
if (reUpdateLater) {
|
||||||
_updateLaterTimer = Timer(Duration(seconds: 60 * 30), () {
|
_updateLaterTimer?.cancel();
|
||||||
_updateLater = false;
|
_updateLaterTimer = Timer(Duration(seconds: 60 * resetTimeMinute), () {
|
||||||
});
|
_updateLater = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
onUpdateLater?.call();
|
onUpdateLater?.call();
|
||||||
},
|
},
|
||||||
config: config ?? (kDebugMode ? UpgradeConfig.development : UpgradeConfig.production),
|
config: config ?? (kDebugMode ? UpgradeConfig.development : UpgradeConfig.production),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue