Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedia/flutter-loadmore
Pull up to load more and pull down to refresh for Flutter ListView
https://github.com/pedia/flutter-loadmore
dart flutter
Last synced: 25 days ago
JSON representation
Pull up to load more and pull down to refresh for Flutter ListView
- Host: GitHub
- URL: https://github.com/pedia/flutter-loadmore
- Owner: pedia
- License: bsd-2-clause
- Created: 2017-12-09T05:43:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-29T18:17:13.000Z (over 4 years ago)
- Last Synced: 2024-08-22T22:51:04.784Z (3 months ago)
- Topics: dart, flutter
- Language: Dart
- Homepage:
- Size: 977 KB
- Stars: 26
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_loadmore
A widget that supports idiom of "Pull Down to Refresh & Pull Up to Load More" for ListView .
Material never have this.## Getting Started
add to pubspec.yaml
```txt
flutter_loadmore: ^2.0.1
``````dart
import 'package:flutter_loadmore/flutter_loadmore.dart';Future> _handleLoadMore() {
// fetch data async
return widget.provider.fetchNextChunk().then((_) {
setState(() {});
});
}Widget build(BuildContext context) {
return LoadMore(
onLoadMore: _handleLoadMore,
child: ListView.builder(
itemCount: widget.provider.data.length,
itemBuilder: (BuildContext context, int index) {
final item = widget.provider.data[index];
return ListTile(title: Text(item.name));
},
),
);
}
```
Full example (fetch stock via HTTPS) in example folder.