diff --git a/lib/ui/app_router.dart b/lib/ui/app_router.dart index 79f7dc9..1955adc 100644 --- a/lib/ui/app_router.dart +++ b/lib/ui/app_router.dart @@ -212,17 +212,14 @@ class AppRouterDelegate extends RouterDelegate @override Widget build(BuildContext context) { + final pages = _buildPages(context); + return Navigator( key: navigatorKey, reportsRouteUpdateToEngine: true, - pages: _buildPages(context), - onPopPage: (route, result) { - if (!route.didPop(result)) { - return false; - } + pages: pages, + onDidRemovePage: (page) { _popState(); - - return true; }, ); } diff --git a/lib/ui/home/navigation_page.dart b/lib/ui/home/navigation_page.dart index 228d7c8..2f92c9a 100644 --- a/lib/ui/home/navigation_page.dart +++ b/lib/ui/home/navigation_page.dart @@ -1409,7 +1409,7 @@ class _ContextualAppBar extends StatelessWidget { Widget build(BuildContext context) { return PopScope( canPop: false, - onPopInvoked: (didPop) async { + onPopInvokedWithResult: (didPop, result) async { onBackPressed?.call(); }, child: AppBar( diff --git a/lib/ui/settings/settings_page.dart b/lib/ui/settings/settings_page.dart index 47608a0..a66a4cb 100644 --- a/lib/ui/settings/settings_page.dart +++ b/lib/ui/settings/settings_page.dart @@ -319,13 +319,8 @@ class _SettingsRouterDelegate extends RouterDelegate key: navigatorKey, reportsRouteUpdateToEngine: true, pages: _buildPages(context), - onPopPage: (route, result) { - if (!route.didPop(result)) { - return false; - } + onDidRemovePage: (page) { _currentState = const _SettingsRouterState.home(); - - return true; }, ); }