-
Notifications
You must be signed in to change notification settings - Fork 6
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
Propagate NavbarItem updates to NavigationBar #45
Conversation
@@ -191,17 +191,24 @@ class _NavbarRouterState extends State<NavbarRouter> | |||
initialize(); | |||
} | |||
|
|||
void initialize({bool isUpdate = false}) { | |||
void initialize() { | |||
NavbarNotifier.length = widget.destinations.length; | |||
for (int i = 0; i < NavbarNotifier.length; i++) { | |||
final navbaritem = widget.destinations[i].navbarItem; | |||
keys.add(GlobalKey<NavigatorState>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are no longer reinitializing keys on update. I am quite not sure if this will be a problem if the navbar Items change. e.g if the number of items increeases or decreases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can update navbar items on demand? What is the reason for this feature may I ask?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assume an app that allows users to acces app content without login and when the user logs in the the profile tab is shown.
e.g consider the tabs
Without login: home, explore, search
after login: home, explore, search , Profile
Expose NavigationRail properties to NavbarDecoration
Co-authored-by: Mahesh Jamdade <[email protected]>
Support for badges on the NavbarItem
Updates to icon are now reflected
Pre-launch Checklist
///
).flutter test
If you need help, consider pinging the maintainer @maheshmnj