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

[bug]: bottom nav bar example shows wrong selected nav bar item after browser refresh #911

Closed
mraaz97 opened this issue Mar 22, 2023 · 5 comments · Fixed by #963
Closed
Assignees

Comments

@mraaz97
Copy link
Contributor

mraaz97 commented Mar 22, 2023

Describe the bug

The bottom nav bar example demonstrates the usage of the NestedRouter() with an AppBar() Widget. Selecting the NavBar Item 'History' e.g. will select the item and leads to this url: .../bottom-nav-example/history-view. After refreshing the browser, the url is still the same as expected and also shows the HistoryView but the favorites icon is selected.

To reproduce

  1. Run router_example
  2. Navigate to history view via the app bar item
  3. Refresh the browser
  4. HistoryView is shown but Favorites Icon is selected

Expected behavior

Since there are many scenarios where Nested Routing is used with an appbar the expected behavior in web would be to see the correct nav bar item selected.

Screenshots

Bildschirmfoto 2023-03-22 um 14 18 22

Additional Context

No response

@FilledStacks
Copy link
Contributor

@mraaz97 yes, I actually saw this when I migrated the web app. It can be fixed using exactly this technique to get the url path id and match it with the tab.

When we get some time we will update the example to include this information. Thank you for creating the issue. It will help make sure it doesn't slip through the cracks.

@FilledStacks
Copy link
Contributor

Fix the issue in the example using the described solution.

@ferrarafer ferrarafer self-assigned this May 24, 2023
@ferrarafer
Copy link
Contributor

@mraaz97 where is the example app you mentioned? I wanna work on this bug.

@mraaz97
Copy link
Contributor Author

mraaz97 commented May 25, 2023

Hi @ferrarafer, you can find it here: https://github.com/Stacked-Org/stacked/blob/master/example/router_example/lib/ui/bottom_nav/bottom_nav_example.dart

@FilledStacks
Copy link
Contributor

🎉 This issue has been resolved in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants