load_items 0.1.0 load_items: ^0.1.0 copied to clipboard
Load more items when scrolling down a ListView or GridView.
load_items #
Load new items when scrolling to the bottom of a ListView
or GridView
.
Features #
- load new items when scrolling to the bottom of a
ListView
orGridView
- pagination support by passing the previous items to
ItemsLoader
- add custom widget builders for items, loaders and empty widgets
- configurable
ListView
andGridView
- configure when to load more via
loadScrollFactor
- pull-to-refresh to reload data
- force refresh using a
Listenable
Example #
LoadMore<Item>(
loadMoreType: LoadMoreType.grid,
itemBuilder: (context, Item item, int index) {
return ListTile(title: item.title);
},
itemsLoader: (List<Item> currentItems) {
return await Api.fetch({skip: currentItems.length});
},
gridCrossAxisCount: 3,
)
See example for full list and grid example.