lazy_load_refresh_indicator

Last updated:

0 purchases

lazy_load_refresh_indicator Image
lazy_load_refresh_indicator Images
Add to Cart

Description:

lazy load refresh indicator

LazyLoadRefreshIndicator #
A simple Flutter Widget which provide PullToRefresh and LoadMore functionality based on flutters RefreshIndicator.
How to use #
Add lazy_load_refresh_indicator to your pubspec:
depencenies:
lazy_load_refresh_indicator: # latest version on pub
copied to clipboard
Add the LazyLoadRefreshIndicator to your Widget
int itemCount = 20;
bool isLoading = false;

Future<void> onRefresh() async => Future.delayed(Duration(seconds: 2),() => setState(()=> itemCount = 20));

void onEndOfPage() async {
setState(()=> isLoading = true);
await Future.delayed(Duration(seconds: 2),(){});
setState((){
isLoading = false;
itemCount += 20;
});
}


Widget build(BuildContext context){
return Scaffold(
appBar: AppBar(
title: Text('Some Title'),
),
body: LazyLoadRefreshIndicator(
child: ListView.builder(
itemBuilder: (context,index) => ListTile(
title: Text('$index'),
),
itemCount: itemCount,
),
onEndOfPage: onEndOfPage,
onRefresh: onRefresh,
scrollOffset: 150,
isLoading: isLoading,
),
);
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.