marcglasberg / indexed_list_view

Flutter package: Similar to a ListView, but lets you programmatically jump to any item, by index.
BSD 2-Clause "Simplified" License
251 stars 21 forks source link

Require shrinkWrap property to work with slivers. #30

Closed tehsunnliu closed 3 years ago

tehsunnliu commented 3 years ago

Same as ScrollablePositionedList, indexed_list_view also lacks the mentioned property. Please add this feature.

marcglasberg commented 3 years ago

With shrinkWrap: true, a ListView only occupies the space it needs, when the sum of its items is smaller than the available space. A ScrollablePositionedList is finite, so it makes sense to have this parameter. An IndexedListView, however, is infinite. It works only with an infinite number of items. For this reason, no matter how small are the items, they will never fit a space smaller than the available space. Therefore, shrinkWrap: true doesn't make sense here.

tehsunnliu commented 3 years ago

Oh. Thank you so much for the information. I was trying to implement IndexedListView with NestedScrollView and SliverAppBar, however, I was not able to get the scrolling to work. Ill try again.