From d4aaf355701dd8ec9aef41b75d8a0d8a0fc7dca8 Mon Sep 17 00:00:00 2001 From: Gautier Date: Fri, 5 Jan 2024 19:22:00 +0100 Subject: [PATCH] Fix WillPopScope erro --- lib/bart/widgets/nested_navigator.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)) {