![]() |
VOOZH | about |
Infinite lists are a way to display paginated data efficiently. When a user scrolls to the end of the current page, more data is fetched and added to the list. This is also known as endless scrolling pagination, infinite scrolling pagination, auto-pagination, lazy loading pagination, and progressive loading pagination. It is good because it loads data only when the user interacts with the list. When data in the list is bigger it is better to use this widget for the app's performance optimizations and Interactive UI for Users.
We will create a user list with his/her name and email address. We get these data from Punk API. We will call an API Call to get data from it. A sample video is given below to get an idea about what we are going to do in this article.
To set up Flutter Development on Android Studio please refer to Android Studio Setup for Flutter Development, and then create a new project in Android Studio please refer to Creating a Simple Application in Flutter.
Pagination Controllers is controller to manage the data refresh it,add page listeners
To get the data from sample API we will use http package
We create a function which will add the data in page controller
We will add a listener in init state to call the previous function whenver user go to next page or when more data is required to load
Now we will add a paged listview in our screens
You are good to go!!!
We have used the listview seperated here to show the data. You can use different widget available in
In all this option seperated constructor is also available