You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TabBarView to take a IndexedWidgetBuilder, as alternative to list of children #13416
I want to make an "infinite" TabBarView, but it is impossible with the children attribute (setting childCount unrealistic high could simulate this).
A solution could be to have TabBarView take an IndexedWidgetBuilder as argument as an alternative to the children attribute, and build children when needed.
This is probably a use case that is contrary to the material design guidelines, so it's not something I would expect Flutter to support in the near term (if ever).
However, you can totally implement that in your app if you want. I would recommend starting by cloning the tabs.dart file into your project, so that you can adjust the relevant classes as you desire.
A use case for this could be a calendar view, where the user swipes back and forth between weeks/months/years. Or any use case basically where the content is dynamically generated would need an indexed build callback.
Btw. this has nothing to do with tabs - i am only refering to the TabBarView which, according to Flutters own docs, is only "Typically used in conjunction with a TabBar."
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 flutter doctor -v and a minimal reproduction of the issue.
Activity
Hixie commentedon Dec 7, 2017
This is probably a use case that is contrary to the material design guidelines, so it's not something I would expect Flutter to support in the near term (if ever).
However, you can totally implement that in your app if you want. I would recommend starting by cloning the tabs.dart file into your project, so that you can adjust the relevant classes as you desire.
Hixie commentedon Dec 7, 2017
(Specifically, the material UI guidelines encourage as few tabs as possible.)
j4k0bk commentedon Dec 8, 2017
A use case for this could be a calendar view, where the user swipes back and forth between weeks/months/years. Or any use case basically where the content is dynamically generated would need an indexed build callback.
Btw. this has nothing to do with tabs - i am only refering to the TabBarView which, according to Flutters own docs, is only "Typically used in conjunction with a TabBar."
j4k0bk commentedon Dec 8, 2017
My current hack to achieve this is to extend ListBase and override the [] operator, and within it call an IndexedWidgetBuilder.
Kripner commentedon Mar 20, 2018
@j4k0bk Neat. I've tried implementing it and it doesn't seem to work. Could you please share your code?
Kripner commentedon Mar 20, 2018
My best solution involves picking some large number and passing it to the tab controller & tab bar view. Does your solution avoid that?
Hixie commentedon Jun 17, 2018
I'm going to close this based on my comments above.
github-actions commentedon Sep 3, 2021
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
flutter doctor -vand a minimal reproduction of the issue.