vedartm / paginate_firestore

A flutter package to simplify pagination with firestore data 🗃
https://pub.dev/packages/paginate_firestore
MIT License
113 stars 136 forks source link

added onReachedEnd handler and filter listener #34

Closed claudemircasa closed 3 years ago

claudemircasa commented 3 years ago

The onReachedEnd function receives a state reference of type PaginationLoaded when the list came to an end. With this reference you can access the list of documents, for example:

onReachedEnd: (state) {
    List<DocumentSnapshot> documents = state.documentSnapshots;
}

You can filter cached list items using a listener of type PaginateFilterChangeListener, like this:

PaginateFilterChangeListener filterChangeListener = PaginateFilterChangeListener();

...
    listeners: [
        searchChangeListener
    ],
...

filterChangeListener.filter = "my_filter_string";