How to solve: Flutter Navigator - push to the same page
how is the best way to push to the same page?
I have route A>B>C
and now, at page C I want do action, and after it I want push to C, but remove old C from route, so:
I have: A>B>C
And execute this code on Page C
Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (context) => C(param: myParam), ), );
And I have A>B>C>C How to change this code to get new route ' A>B>C' after second push to page C? I just want delete last navigation from route
If you are in the same page you want to push, you could do:
Which will pop current page (C) and push C.