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
Hey @hemanthvings 👋
Thanks for creating an issue and sorry for a late response.
This is a strange issue that I've been seeing in some old versions too. Interesting fact is that after some more navigation, browser buttons seem to work as expected.
I have now investigated it fully and can provide a detailed explanation of why it happened.
In the MyApp, for the "root screen" we have this configuration
Now RoutesLocationBuilder must surround the HomeScreen widget with a BeamPage and provide a key for it. The key to be selected is something like ValueKey(state.routeInformation.location). The important thing to note here is that Navigator will rebuild its pages only if the key has changed between 2 navigation events.
So we start of with that 1 root page in our root Navigator and it initially has the key ValueKey(/books). Then we navigate (but with nested Beamer!) to /articles or /books/2 and see that the nested Beamer properly updates the URL. When we press the browser back button to go back to /books, that event goes to root Beamer (the one with 1 root page with ValueKey(/books)), so it decides not to rebuild itself because this is the same key that the page already has!
The solution is for nested Beamer to properly rebuild when listening to changes on its parent. There was a bug that @MarkRunWu noticed as a related issue and fixed before I managed to take a proper look due to vacation and illness. Thanks again! 💙
So now the 1 root page will still not rebuild (and this is OK), but the nested Beamer that was on /books/2 or /articles will rebuild when its parents notifies it of /books.
I am now going to cherry-pick this into v1.5 branch and publish v1.5.2 on pub dev.
Describe the bug
Browser Back button doesn't work, haven't tested in mobile
Only url changes page or title won't change
Beamer version: (e.g.
v0.14.1
,master
, ...)1.5.0
To Reproduce
Steps to reproduce the behavior:
Run the example: bottom_navigation
Expected behavior
url change should change the page also
Screenshots
2022_07_31_212401.mp4
The text was updated successfully, but these errors were encountered: