Open
Description
I encountered an issue where using Navigator.popUntil
inside a WillPopScope (WillPopCallback)
seems to break the navigation flow in my Flutter app.
Here are the details:
-
Navigate to a screen using 'MaterialPageRoute'.
Example
Navigator.push( context, MaterialPageRoute(builder: (context) => ScreenC()), );
-
Implement a
WillPopScope
withonWillPop
that containsNavigator.popUntil
.Example
@override Widget build(BuildContext context) { return WillPopScope( onWillPop: () async { Navigator.popUntil( context, (route) => route.isFirst, ); return false; }, child: Container(), ); }
-
Use the back gesture to navigate back.
Actual Behavior:
Instead, the navigation behaves unexpectedly, and I encounter issues with the navigation flow.
On my real project the screen freezes completely and is unresponsive.
On example project after swipe-to-go-back the navigation doesn't work anymore.
Video
Problem with ScreenA where I'm trying to navigate to ScreenA https://github.com/fluttercandies/ios_willpop_transition_theme/assets/22656185/0f636e7a-82e9-41c6-bdc6-94f4dea85342Expected Behavior:
I expect the app to navigate back to the desired route.
Metadata
Metadata
Assignees
Labels
No labels