You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my android app I am using Routemaster for navigation and Riverpod for state management.
The app starts off on an Indexed Page with a bottom bar, which provides access to two subpaths. One of them should be only accessible if the user is logged in, else he should be redirected to a login page. This is accomplished through Route-swapping as described in the FAQ here (https://github.com/tomgilder/routemaster#swap-routing-map), but using Riverpod rather than Provider.
I experience inconsistent behaviour of the Redirect() route, as sometimes it is rendered INSIDE the Indexed page stack, and sometimes OUTSIDE. I would like to achieve a consistent behaviour.
Check out this simplified sample then read the sample flow further below.
The user taps on Path 2 and the redirect triggers. The login page is rendered WITHIN the Indexed Page stack (the bottom bar is still visible). I am not sure this is the supposed behaviour, as '/login' is outside the paths in the indexed stack, thus I would expect the login page to be rendered ON TOP of the current page. However, if this is how redirects are supposed to work then it's ok as long as the behavior is consistent.
The user logs in. The route map is swapped and the user is redirected on '/path1'.
The user now choses to log out from '/path1'. The route map is swapped again and the '/login' page REPLACES the Indexed Page stack. No bottom navigation bar is visible anymore. Obviously this is inconsistent with what happened when the user first logged in.
Furthermore, in this situation the behavior of the top-left back button is different than the one obtained by pressing the Android back button. The former returns to '/' (and thus '/path1'), the latter exits the application entirely.
Expected behaviour:
For the '/login' page to be consistently rendered as a REPLACEMENT for the Indexed Page stack, as it is not among the specified indexed paths.
For the back buttons behaviour to be identical wherever, preferably reverse-cronological.
Thanks for any feedback, hope I am just doing something wrong rather than it being a bug :)
The text was updated successfully, but these errors were encountered:
In my android app I am using Routemaster for navigation and Riverpod for state management.
The app starts off on an Indexed Page with a bottom bar, which provides access to two subpaths. One of them should be only accessible if the user is logged in, else he should be redirected to a login page. This is accomplished through Route-swapping as described in the FAQ here (https://github.com/tomgilder/routemaster#swap-routing-map), but using Riverpod rather than Provider.
I experience inconsistent behaviour of the Redirect() route, as sometimes it is rendered INSIDE the Indexed page stack, and sometimes OUTSIDE. I would like to achieve a consistent behaviour.
Check out this simplified sample then read the sample flow further below.
Sample app:
Sample flow:
Path 2
and the redirect triggers. The login page is rendered WITHIN the Indexed Page stack (the bottom bar is still visible). I am not sure this is the supposed behaviour, as '/login' is outside the paths in the indexed stack, thus I would expect the login page to be rendered ON TOP of the current page. However, if this is how redirects are supposed to work then it's ok as long as the behavior is consistent.Expected behaviour:
Thanks for any feedback, hope I am just doing something wrong rather than it being a bug :)
The text was updated successfully, but these errors were encountered: