From c029a3cebbc8c6018ae62c09f041fde82e39e8cb Mon Sep 17 00:00:00 2001 From: "DESKTOP-I3JPKHK\\wy" <1111> Date: Wed, 10 Dec 2025 20:40:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A8=8D=E5=90=8E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=20onUpdateLater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app_upgrade_simple.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/app_upgrade_simple.dart b/lib/app_upgrade_simple.dart index 352e245..28dc39b 100644 --- a/lib/app_upgrade_simple.dart +++ b/lib/app_upgrade_simple.dart @@ -227,6 +227,7 @@ class AppUpgradeSimple { bool? showNoUpdateToast, bool? autoInstall, BoolCallback? onComplete, + VoidCallback? onUpdateLater, UpgradeConfig? config, }) async { // 使用传入的配置或默认配置 @@ -255,6 +256,7 @@ class AppUpgradeSimple { info: info, autoInstall: finalAutoInstall, onComplete: onComplete, + onUpdateLater: onUpdateLater, config: effectiveConfig, ); } catch (e) { @@ -307,6 +309,7 @@ class AppUpgradeSimple { required UpgradeInfo info, bool? autoInstall, BoolCallback? onComplete, + VoidCallback? onUpdateLater, UpgradeConfig? config, }) async { final effectiveConfig = config ?? _config; @@ -330,6 +333,7 @@ class AppUpgradeSimple { info: info, autoInstall: finalAutoInstall, onComplete: onComplete, + onUpdateLater: onUpdateLater, config: effectiveConfig, ); } @@ -480,6 +484,7 @@ class AppUpgradeSimple { required UpgradeInfo info, required bool autoInstall, BoolCallback? onComplete, + VoidCallback? onUpdateLater, UpgradeConfig? config, }) { final effectiveConfig = config ?? _config; @@ -499,6 +504,7 @@ class AppUpgradeSimple { info: info, autoInstall: autoInstall, onComplete: onComplete, + onUpdateLater: onUpdateLater, config: effectiveConfig, showToast: (message) => _showToast(message, context, effectiveConfig), ); @@ -1949,6 +1955,7 @@ class _SimpleUpgradeDialog extends StatefulWidget { final UpgradeInfo info; final bool autoInstall; final BoolCallback? onComplete; + final VoidCallback? onUpdateLater; final void Function(String) showToast; final UpgradeConfig config; @@ -1956,6 +1963,7 @@ class _SimpleUpgradeDialog extends StatefulWidget { required this.info, required this.autoInstall, this.onComplete, + this.onUpdateLater, required this.showToast, required this.config, }); @@ -1971,6 +1979,7 @@ class _SimpleUpgradeDialogState extends State<_SimpleUpgradeDialog> with _Upgrad void Function(String) get showToast => widget.showToast; @override BoolCallback? get onComplete => widget.onComplete; + VoidCallback? get onUpdateLater => widget.onUpdateLater; @override bool get autoInstall => widget.autoInstall; @override @@ -2058,6 +2067,7 @@ class _SimpleUpgradeDialogState extends State<_SimpleUpgradeDialog> with _Upgrad onPressed: () { Navigator.of(context).pop(); widget.onComplete?.call(false); + widget.onUpdateLater?.call(); }, child: const Text('稍后更新'), ),