LoadMoreListView.builder(
//is there more data to load
haveMoreItem: true,
//Trigger the bottom loadMore callback
onLoadMore: () async{
//wait for your api to fetch more itemsawaitFuture.delayed(constDuration(seconds: 1));
},
//pull down refresh callback
onRefresh: () async{
//wait for your api to update the listawaitFuture.delayed(constDuration(seconds: 1));
},
//you can set your loadMore Animation
loadMoreWidget: Container(
margin: constEdgeInsets.all(20.0),
alignment: Alignment.center,
child: constCircularProgressIndicator(
valueColor: AlwaysStoppedAnimation(Colors.blueAccent),
),
),
//ListView
itemCount: 20,
itemBuilder: (context, index) {
returnContainer(
margin: constEdgeInsets.all(30),
width: double.infinity,
alignment: Alignment.center,
child: Text('$index'),
);
},
);