0
votes

I was able to implement Firestore Pagination using a stateful widget but would love to re-write it using Riverpod's ChangeNotifier.

The challenge is that the fact that two functions are used, one for getting the first chunk of documents and the other for getting the rest, then adding them to the previous documents, the aspect of a scrollController to fetch more documents as the user scrolls and keeping track of the loading state when fetching more documents makes it a little challenging.

There is a package called paginate_firestore that helps with firestore pagination but it lacks caching and the ability to map firestore documents to a model class.

Thank you very much.