The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
In the example device represents the size of the screen for which I have slightly different designs. On mobile login and register will be different tabs (/auth/login or /auth/register) in a PageView while on other form factors they both can go side by side (just /auth).
With the above code, if I type /auth/recover in my browser with a small screen the forgot screen is stacked on top of /auth as one would expect. However, when i tap the back button I go to /auth so there is no redirect.
The question is: should the redirect in a route be evaluated when popping or is this the intended behaviour.
This may be intended but I noticed that when going back the redirect is not evaluated. Consider the following example:
In the example
device
represents the size of the screen for which I have slightly different designs. On mobile login and register will be different tabs (/auth/login
or/auth/register
) in a PageView while on other form factors they both can go side by side (just/auth
).With the above code, if I type
/auth/recover
in my browser with a small screen the forgot screen is stacked on top of/auth
as one would expect. However, when i tap the back button I go to/auth
so there is no redirect.The question is: should the redirect in a route be evaluated when popping or is this the intended behaviour.