Skip to content

Commit

Permalink
Fix WillPopScope erro
Browse files Browse the repository at this point in the history
  • Loading branch information
g-apparence committed Jan 5, 2024
1 parent 7942160 commit d4aaf35
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/bart/widgets/nested_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class _NestedNavigatorState extends State<NestedNavigator>

@override
Widget build(BuildContext context) {
final content = WillPopScope(
final content = PopScope(
child: Navigator(
key: widget.navigationKey,
initialRoute: widget.initialRoute,
Expand Down Expand Up @@ -106,7 +106,10 @@ class _NestedNavigatorState extends State<NestedNavigator>
);
},
),
onWillPop: () {
onPopInvoked: (willPop) {
if (!willPop) {
return;
}
showBottomBar(context);
if (widget.onWillPop != null) {
widget.onWillPop!();
Expand All @@ -115,7 +118,6 @@ class _NestedNavigatorState extends State<NestedNavigator>
widget.navigationKey.currentState!.canPop()) {
widget.navigationKey.currentState!.pop();
}
return Future<bool>.value(false);
},
);
return switch ((kIsWeb, widget.sideBarOptions)) {
Expand Down

0 comments on commit d4aaf35

Please sign in to comment.