beamer icon indicating copy to clipboard operation
beamer copied to clipboard

Is there a way to pop all routes and push one route?

Open pavittarsingh315 opened this issue 2 years ago • 1 comments

With the default Navigator, we can do Navigator.of(context).pushAndRemoveUntil(newPage, (route) => false); which will push the newPage widget and pop all the rest essentially resetting the stack. Is there a way to do this using Beamer?

Thank you.

pavittarsingh315 avatar Jun 21 '22 05:06 pavittarsingh315

Hey @pavittarsingh315 :wave: Sorry for a late response :disappointed:

"Navigator 2.0" and this Beamer works by rebuilding the entire navigation stack every time you navigate so it should be possible. This may require you to use define your custom BeamLocations where you explicitly define how you would like your stack to look for each navigation event that happens.

It is a bit broad question so that's all I can say for now - it is possible, but the logic behind it is quite different than the old Navigator API.

slovnicki avatar Jul 06 '22 21:07 slovnicki