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

Modular.to.popUntil closing improper route #922

Open
ClayseNascimento opened this issue Dec 11, 2023 · 0 comments
Open

Modular.to.popUntil closing improper route #922

ClayseNascimento opened this issue Dec 11, 2023 · 0 comments
Labels
new New issue request attention

Comments

@ClayseNascimento
Copy link

ClayseNascimento commented Dec 11, 2023

flutter_modular-5.0.3

According to the documentation, when using Modular.to.popUntil(ModalRoute.withName('/routeOne')) the pop is called repeatedly until the predicate is true. However, I have a problem that, when it finds the route passed in ModalRoute.withName, the predicate becomes true, but it also closes the informed route. I understand that this route should be kept on the stack. Am I right?

How should it be:

Modular.to.popUntil(ModalRoute.withName('routeC'))

That is, instead of navigating to 'routeC', it closes 'routeC' as well.
To solve this problem, it was necessary to use an unconventional way:

history = [‘routeA', 'routeB’, ‘routeC’, ‘routeD', ‘routeE']
Modular.to.popUntil(ModalRoute.withName(
                      history.elementAt(history.indexOf(‘routeC’) + 1))
                   )

Is there a fix for this?

@ClayseNascimento ClayseNascimento added the new New issue request attention label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New issue request attention
Projects
None yet
Development

No branches or pull requests

1 participant