Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can we "pop" to a specific screen in a tab's navigation stack ? #7

Closed
SogoGolf opened this issue Apr 26, 2020 · 4 comments
Closed

can we "pop" to a specific screen in a tab's navigation stack ? #7

SogoGolf opened this issue Apr 26, 2020 · 4 comments

Comments

@SogoGolf
Copy link

Lets say that we have 4 x screens in a navigation stack on tab 1.

Then we navigate the the 4th (last) screen in that navigation stack.

Is there a way that we can "pop" back to (say) the 2nd screen ?

If not, can this feature be added ?

@SogoGolf
Copy link
Author

this was my bad as i can see its working as expected with Flutter api's:

for anyone else wondering:

pop to any screen in the nav graph for a given tab:

Navigator.of(context).popUntil((route) {
     return route.settings.name == "Screen2";
});

pop back to first screen in the nav graph for a given tab:
Navigator.of(context).popUntil(ModalRoute.withName("/"));

might be worth you updating the readme with a simple example as im sure others will benefit

@BilalShahid13
Copy link
Owner

A decent suggestion. Thank you 👍

@anup-geeky
Copy link

anup-geeky commented May 7, 2020

@SogoGolf where you have put this code? What I want when I press Home Tab and if I'm on Screen2 of Home (Home->Screen1->Screen2) then pop all screen and show Home.

@lyf571321556
Copy link

en2 of Home (Home-

do you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants