We have implemented this functionality of preloading in which when a user is on a photo album the pictures load as per the pages, the first-page load certain picture items once a user has scrolled down all the way through the first page then after the other pictures of another page loads, now we want pictures to load constantly as the user scrolls down the page and not as per the particular pages with fixed picture items. Would really appreciate the suggested approach. Implemented code is down below, please suggest the manipulation of it to achieve the requirement.
scrollController.addListener(() {
if (isloading) {
return;
}
double maxScroll = scrollController.position.maxScrollExtent;
double currentScroll = scrollController.position.pixels;
if (currentScroll == maxScroll && hasMore!) {
fetchPhotos();
// hasMoreAndMaxScroll = true;
update();
// print("call function update");
// print("call function");
} else {
// scrollController.jumpTo(0);
// print("call function");
}
});
callAnalysis(Appstring.resourcestring[Appstring.albumphotolist].toString());
super.onInit();
}