-
Notifications
You must be signed in to change notification settings - Fork 56
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
Bottom navbar item list is not growable. #156
Comments
Hi, thank you for opening this issue. |
I also need the ability to dynamically change the number of tabs in my app.
It was my expectation that the tab bar should indeed be persistent, i.e. not need rebuilding from scratch ever, while also supporting dynamically changing numbers of tabs. It is standard practice in Flutter to allow different numbers of items in any sort of container between different calls to In With |
Yes it will indeed need quite some amount of work to do that, so that will probably take some time, sorry... I'll try looking into fixing that. |
UX is always contextual. In my app, continuing to show a tab for a feature that the user just manually disabled doesn't make any sense. |
Version
5.2.1
Flutter Doctor Output
What platforms are you seeing the problem on?
Android
What happened?
On a fresh run (reinstall with data clear) with this pkg build,
It shows red screen with "cannot add to a fixed-length list" error.
My app use case:
I have maintained bottom bar widget and kept a toggling boolean to one of the tab option to hide or show it on UI
which is listening values using Provider state management.
I tried to set growable flag to true in addAll() method (PFA 1)
and here too (PFA 2)
But after this it throws this exception
could be because focusNodes index doesn't get updated with provider updated values of tablist.
════════ Exception caught by widgets library ═══════════════════════════════════ RangeError (index): Invalid value: Not in inclusive range 0..1: 2 The relevant error-causing widget was: ════════════════════════════════════════════════════════════════════════════════
The list of tab options should support 'growable' list functionality, so that Tab list can handled dynamically in the code.
Steps to reproduce
Run provided code with
where any one option should be handled
with a boolean flag in the Firebase Realtime database
listened using Provider state management.
Code to reproduce the problem
Relevant log output
Screenshots
(PFA 1)
(PFA 2)
The text was updated successfully, but these errors were encountered: