diff --git a/frontend/mobile-app/lib/core/updater/channels/self_hosted_updater.dart b/frontend/mobile-app/lib/core/updater/channels/self_hosted_updater.dart index fcf77086..dc2ffa24 100644 --- a/frontend/mobile-app/lib/core/updater/channels/self_hosted_updater.dart +++ b/frontend/mobile-app/lib/core/updater/channels/self_hosted_updater.dart @@ -51,9 +51,9 @@ class SelfHostedUpdater { void _showMarketUpdateDialog(BuildContext context, VersionInfo versionInfo) { showDialog( context: context, - barrierDismissible: !versionInfo.forceUpdate, + barrierDismissible: false, builder: (context) => PopScope( - canPop: !versionInfo.forceUpdate, + canPop: false, child: AlertDialog( title: Text( versionInfo.forceUpdate ? '发现重要更新' : '发现新版本', @@ -144,9 +144,9 @@ class SelfHostedUpdater { BuildContext context, VersionInfo versionInfo) { showDialog( context: context, - barrierDismissible: !versionInfo.forceUpdate, + barrierDismissible: false, builder: (context) => PopScope( - canPop: !versionInfo.forceUpdate, + canPop: false, child: AlertDialog( title: Text( versionInfo.forceUpdate ? '发现重要更新' : '发现新版本', diff --git a/frontend/mobile-app/lib/core/updater/update_service.dart b/frontend/mobile-app/lib/core/updater/update_service.dart index 09df23e2..185e8e83 100644 --- a/frontend/mobile-app/lib/core/updater/update_service.dart +++ b/frontend/mobile-app/lib/core/updater/update_service.dart @@ -110,48 +110,52 @@ class UpdateService { await showDialog( context: context, - builder: (context) => AlertDialog( - title: Text( - '发现新版本', - style: TextStyle( - fontSize: 18.sp, - fontWeight: FontWeight.w600, - color: const Color(0xFF292524), + barrierDismissible: false, + builder: (context) => PopScope( + canPop: false, + child: AlertDialog( + title: Text( + '发现新版本', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.w600, + color: const Color(0xFF292524), + ), ), - ), - content: Text( - '有新版本可用,是否立即更新?', - style: TextStyle( - fontSize: 14.sp, - color: const Color(0xFF57534E), + content: Text( + '有新版本可用,是否立即更新?', + style: TextStyle( + fontSize: 14.sp, + color: const Color(0xFF57534E), + ), ), - ), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context), - child: Text( - '稍后', - style: TextStyle( - fontSize: 14.sp, - color: const Color(0xFF78716C), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: Text( + '稍后', + style: TextStyle( + fontSize: 14.sp, + color: const Color(0xFF78716C), + ), ), ), - ), - ElevatedButton( - onPressed: () { - Navigator.pop(context); - GooglePlayUpdater.performFlexibleUpdate(); - }, - style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFFD4A84B), - foregroundColor: Colors.white, + ElevatedButton( + onPressed: () { + Navigator.pop(context); + GooglePlayUpdater.performFlexibleUpdate(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFFD4A84B), + foregroundColor: Colors.white, + ), + child: Text( + '更新', + style: TextStyle(fontSize: 14.sp), + ), ), - child: Text( - '更新', - style: TextStyle(fontSize: 14.sp), - ), - ), - ], + ], + ), ), ); }