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

Propagate NavbarItem updates to NavigationBar #45

Merged
merged 36 commits into from
Apr 30, 2024
Merged

Propagate NavbarItem updates to NavigationBar #45

merged 36 commits into from
Apr 30, 2024

Conversation

maheshj01
Copy link
Owner

Updates to icon are now reflected

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing using flutter test

If you need help, consider pinging the maintainer @maheshmnj

@@ -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>());
Copy link
Owner Author

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.

Copy link
Contributor

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?

Copy link
Owner Author

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

@maheshj01 maheshj01 changed the title fix: issue #38 Propagate NavbarItem updates to NavigationBar Apr 21, 2024
@maheshj01 maheshj01 merged commit 27e6fa0 into main Apr 30, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants