diff --git a/lib/bart/widgets/nested_navigator.dart b/lib/bart/widgets/nested_navigator.dart index c2d9fe6..5826518 100644 --- a/lib/bart/widgets/nested_navigator.dart +++ b/lib/bart/widgets/nested_navigator.dart @@ -45,7 +45,7 @@ class _NestedNavigatorState extends State @override Widget build(BuildContext context) { - final content = WillPopScope( + final content = PopScope( child: Navigator( key: widget.navigationKey, initialRoute: widget.initialRoute, @@ -106,7 +106,10 @@ class _NestedNavigatorState extends State ); }, ), - onWillPop: () { + onPopInvoked: (willPop) { + if (!willPop) { + return; + } showBottomBar(context); if (widget.onWillPop != null) { widget.onWillPop!(); @@ -115,7 +118,6 @@ class _NestedNavigatorState extends State widget.navigationKey.currentState!.canPop()) { widget.navigationKey.currentState!.pop(); } - return Future.value(false); }, ); return switch ((kIsWeb, widget.sideBarOptions)) {