The Infinite ListView Flutter package provides an infinite scroll listview widget.
- Create a class extending
InfiniteListView<T>
, whereT
is the type of item on the list you are going to build. - Implement the
getItemWidget(T item)
method. This method should return a widget for a single item on the list. - Implement the
getListData(int pageNumber)
method. This is anasync
method and should return a list of items according to the pageNumber parameter. This method should returnFuture.error(...)
in case of an error. - Override
the
getLoadingWidget()
,getPaginationLoadingWidget()
,getErrorWidget(dynamic error)
, andgetPaginationErrorWidget(dynamic error)
methods to customize widgets while the request is in progress and in case of an error.
I'm always working on making improvements. If you have any feedback, issues, or suggestions, feel free to reach out. Happy coding!