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

Multiple widgets using same GlobalKey #1476

Closed
literalEval opened this issue Feb 9, 2023 · 0 comments · Fixed by #1477
Closed

Multiple widgets using same GlobalKey #1476

literalEval opened this issue Feb 9, 2023 · 0 comments · Fixed by #1477
Assignees
Labels
bug Something isn't working

Comments

@literalEval
Copy link
Member

literalEval commented Feb 9, 2023

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Run the app normally and check debug logs

Expected behavior
There should be no errors regarding keys and global keys must be used on individual widgets only once

Actual behavior
Some widgets are inserted in the widget tree multiple times causing Multiple widgets used the same GlobalKey error. This doesn't crash the app, but still is bad and causes problems in testing.

Screenshots

Screenshot_20230209_114120

Additional details
During testing, I found out that this issue comes from explore_events.dart file with this key assignment, along with other pages used in MainScreen Widget

image

The problem is that navBarItems is first initialized with all the BottomNavigationBarItem, but some of these items are again added to the list in the renderBottomNavBarPlugins method.

image

image

image

Fix

Removing duplicate BottomNavigationBarItem addition fixes the problem

I would like to know if this issue is hitting multiple people. @palisadoes @noman2002 @CyberWake @Ayush0Chaudhary

@literalEval literalEval added the bug Something isn't working label Feb 9, 2023
@literalEval literalEval changed the title Bug Report Multiple widgets using same GlobalKey Feb 9, 2023
@github-actions github-actions bot added the unapproved Unapproved, needs to be triaged label Feb 9, 2023
@palisadoes palisadoes removed the unapproved Unapproved, needs to be triaged label Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants