Рет қаралды 24,560
In this episode, I cover building a infinite list view which loads paged data using a offset and limit. I mock a call that retrieves json and show how to update the list view.
I cover these points in the video:
- Fetch paged data using an offset & limit
- Display loading until the data is returned
- Decode JSON into a list of objects
- Scrolling will fetch more paged data
- Scrolling back will fetch cached data
Source code:
gist.github.co...
Source code fixes for Dart 2:
- In this source I explicitly cast.
- I change JSON.decode to new JsonCodec().decode
gist.github.co...
Something I don't cover in this episode, when the cached data grows, it could reach a size detrimental to the application. With this in mind, it could easily be remedied with logic that evicts data loaded in to the cache.