Home > Net >  How to properly navigate to previous page with getx?
How to properly navigate to previous page with getx?

Time:12-30

I have a pages A>B>C>D>E I want to navigate back from page E>B>A

I tried with

 Get.offNamedUntil('B', (route) => false);

But it worked like E>B and then doesn't redirect back to A. Is there any other way to do so?

CodePudding user response:

I would say that you forget a / in the named route, and as a recommendation, don't return false in the callback, set a condition to stop if the named route was not found in the routes stack, as example use route.isFirst :

Get.offNamedUntil('/B', (Route<dynamic> route) => route.isFirst);
  • Related