https://github.com/erf/load_items
Load new items when scrolling to the bottom of a ListView or GridView
https://github.com/erf/load_items
Last synced: over 1 year ago
JSON representation
Load new items when scrolling to the bottom of a ListView or GridView
- Host: GitHub
- URL: https://github.com/erf/load_items
- Owner: erf
- License: mit
- Created: 2021-08-12T21:26:38.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-06T11:19:13.000Z (over 2 years ago)
- Last Synced: 2025-03-09T02:50:30.475Z (over 1 year ago)
- Language: Dart
- Size: 201 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# load_items
Load new items into either a list or a grid as you scroll down.

## Features
* load new items when scrolling to the bottom of a `ListView` or `GridView`
* pagination support by passing the previous items to `ItemsLoader`
* add custom widget builders for items, loaders and empty widgets
* configurable `ListView` and `GridView`
* configure when to load more via `loadScrollFactor`
* pull-to-refresh to reload data
* force refresh using a `Listenable`
* scroll to top using a `Listenable`
* fade out bottom if more option
## Example
```dart
LoadItems(
type: LoadItemsType.grid,
itemBuilder: (context, Item item, int index) {
return ListTile(title: item.title);
},
itemsLoader: (List currentItems) {
return await Api.fetch({skip: currentItems.length});
},
gridCrossAxisCount: 3,
)
```
See [example](./example) for full list and grid example.