Our app is built on top of Scaffold
and to this point we have been able to accommodate most of our routing and navigation requirements using the provided calls within NavigatorState
(pushNamed()
, pushReplacementNamed()
, etc.). What we don't want though, is to have any kind of 'push' animation when a user selects an item from our drawer (nav) menu. We want the destination screen from a nav menu click to effectively become the new initial route of the stack. For the moment we are using pushReplacementNamed() for this to ensure no back arrow in the app bar. But, the slide-in-from-the-right animation implies a stack is building.
What is our best option for changing that initial route without animation, and, can we do that while also concurrently animating the drawer closed? Or are we looking at a situation here where we need to move away from Navigator over to just using a single Scaffold and updating the 'body' directly when the user wants to change screens?
We note there is a replace()
call on NavigatorState
which we assume might be the right place to start looking, but it's unclear how to access our various routes originally set up in new MaterialApp()
. Something like replaceNamed()
might be in order ;-)