fix: 两次返回退出应用 issues #303

This commit is contained in:
guozhigq
2024-01-21 16:09:08 +08:00
parent ec98e5c73c
commit 27c954ec95
2 changed files with 8 additions and 4 deletions

View File

@ -94,7 +94,10 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
localCache.put('sheetHeight', sheetHeight);
localCache.put('statusBarHeight', statusBarHeight);
return PopScope(
onPopInvoked: (bool status) => _mainController.onBackPressed(context),
canPop: false,
onPopInvoked: (bool didPop) async {
_mainController.onBackPressed(context);
},
child: Scaffold(
extendBody: true,
body: PageView(