lazy_loading_list_view 0.0.1
lazy_loading_list_view: ^0.0.1 copied to clipboard
A Flutter package for creating a ListView with lazy loading and pagination.
A Flutter package for creating a ListView with lazy loading and pagination.
Features #
Add this to your Flutter app to:
- Create all ListView's throughout your project using a single reusable widget.
- Handle pagination within ListView's by simply calling a function to load more data.
- Create a unique loading state for your ListView's. By default the LazyLoadingListView will display a Shimmer effect list item when loading more data, similar to that seen in apps such as Facebook, LinkedIn, etc.
Usage #
Install the LazyLoadingListView package by adding the following to your project dependencies within the pubspec.yaml file:
lazy_loading_list_view: ^1.0.0
Add the following to the top of your file:
import 'package:lazy_loading_list_view/lazy_loading_list_view.dart';
Create a LazyLoadingListView using the example below:
LazyLoadingListView<MyData>(
loadItems: (page) async {
// your function to load data for the given page
},
buildItem: (BuildContext context, MyData item) {
// your function to build list item
return MyListItem(item: item);
},
shimmerBuilder: (BuildContext context) {
// Optionally provide a custom loading effect
return MyCustomShimmer();
},
)
Bugs or Feature Requests #
If you encounter any problems feel free to open an issue.
If you feel the library is missing a feature that would be helpful, please raise a ticket on GitHub and we will look into it.
Additional information #
This package was created by Caffeinated Code Ltd. If you find this package useful, you can support it for free by giving it a thumbs up at the top of this page. Here's another option to support the package: