'use api pagination until all the data is fetched in the background
I have a long list of data coming from database, I'm using pagination and i want to fetch all the list in the background and and view it all instead of viewing page by page.
//first using pagination for faster call
var myLongList =[];
myLongList = await fetchData(pageSize);
//then show all the data when it's ready
fetchData().then((value) {
myLongList.clear();
setState(() {
myLongList.addAll(value);
});
});
is that a good approach to follow? or there is something better i can try I'm doing this to give a better user experience without the waiting for every search or every new data.
Solution 1:[1]
I think loading a lot of data at once is not a good practice, when you have a lot of data I think the best thing to do is to use a lazy list
maybe this can help you. https://www.kindacode.com/article/flutter-listview-pagination-load-more/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Arthur Alland |
