I have used the carousel_slider package for displaying posts to my users in my application. I want to load more posts whenever the user reaches the last post in the carousel. Where can I trigger the function that will add more data to the list of items, which in case is
homeData
This is how my code looks:
@override
Widget build(BuildContext context) {
return RefreshIndicator(
onRefresh: getMoreData, //fetches new post on refresh
child: CarouselSlider(
options: CarouselOptions(
height: 650,
enableInfiniteScroll: false,
aspectRatio: 2.0,
enlargeCenterPage: true,
scrollDirection: Axis.vertical,
),
items: homeData, //list of widgets that are displayed in the carousel
),
);
}