-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
BottomNavigationBar breaks when increasing number of items it contains #14466
Comments
try to call |
i have the same issue |
I get the same error when creating a BottomNavigationBar with 'items' being a list of four BottomNavigationBarItems. |
I have the same error with three items. Did a full restart and then it worked. |
Same error with four items in hot reload. A full restart solved. |
Duplicate of #10322 |
I am also getting this issue. This happens after I try to increase the number of items in my bottom navigation bar that starts with 4 items. This error does not occur if I decrease the number of items. Note that I am trying to set the number of items in the bottom navigation bar dynamically as the user moves about the app. It seems there might be some sort of work around with initializing the bottom navigation bar with more items than you'll ever need (like 10), but I'm not sure how to do that without the user seeing it. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I believe that the cause is that the bar's state allocates animation controllers for each item when the state is first constructed, but it doesn't create new controllers when the state updates with more items.
Steps to Reproduce
Create a nav bar with 3 items.
Increase the number of items to 4.
Doctor
Version of Flutter is the current g3 version.
The text was updated successfully, but these errors were encountered: