Closed d-apps closed 4 years ago
There is an attribute itemsPerPage
to set number of items in one page. You can use it like this
PaginateFirestore(
itemBuilder: (context, documentSnapshot) => ListTile(
leading: CircleAvatar(child: Icon(Icons.person)),
title: Text(documentSnapshot.data['name']),
subtitle: Text(documentSnapshot.documentID),
),
// orderBy is compulsary to enable pagination
query: Firestore.instance.collection('users').orderBy('name'),
itemsPerPage: 10
),
I am closing the issue now. If you face any related issue, feel free to reopen it. Thanks for using the package, hope it solved your use case.
When "itemsPerPage" attribute is used, can the firestore "limit" method be used together? Thanks.
itemsPerPage
internally uses firestore's limit
method anyways @waletoyo1
Thanks
Can we control the limit of items per page? if so, how?
How to know when is fetching more documents, like a bool variable, to show some CircularProgressIndicator with "loading more data" to the user?