marcglasberg/indexed_list_view

RangeError (index): does indexed_list_view can only be used if the list is indefinitely? Thank you!

Closed this issue · 1 comments

Hi, I am learning how to use this widget. I replaced my ListView.builder to IndexedListView.builder and with a controller, my list only has a certain number of item, is this the reason I got this error?

my code looks like this:

IndexedListView.builder(
controller: controller,
itemBuilder: (context, index) {
return ListTile(
title: Text(_myList[index].title),
);

Does this work? how can i change it?

Also when we use controller.jumpTo(index), in the example, we only have something like controller.jumpTo(21), the index is a fixed number, but if I create a button and want to click to jump to a certain item, how do I know the index of that items?

Any help appreciated. Maybe it's not really an issue here, but how to apply, thank you!

Lu

Unfortunately this list is useful only when you have an infinite number of items. For example, like a calendar, that never ends. For a finite number if items I suggest you use https://pub.dev/packages/scrollable_positioned_list