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

SetState doesn't work on the paginate firestore #136

Open mubiru-simeon opened 2 years ago

mubiru-simeon commented 2 years ago

Set State doesn't work on the Paginate firestore. Lets say i have a query of a collection called categories and inside it, a document called "utensils" and a nother called "art". Each of these documents has a nested list of documents and other data. I have a variable called "currentlySelected" that storesthe value of the category the user is currently viewing. If i load up the paginate firestore with the initial value as "utensils", it works. If a user presses a button and i use setstate to change the value of currentlySelected to "art", the data shown is still the same from the previous category. The variable in the query doesn't get changed dynamically.

herryelbert commented 2 years ago

Same thing here, I haven't found a way to do this either

karrarfalih commented 2 years ago

me too.

OutdatedGuy commented 2 years ago

Set State doesn't work on the Paginate firestore. Lets say i have a query of a collection called categories and inside it, a document called "utensils" and a nother called "art". Each of these documents has a nested list of documents and other data. I have a variable called "currentlySelected" that storesthe value of the category the user is currently viewing. If i load up the paginate firestore with the initial value as "utensils", it works. If a user presses a button and i use setstate to change the value of currentlySelected to "art", the data shown is still the same from the previous category. The variable in the query doesn't get changed dynamically.

Yo @nirancodelab, can you try using the key property in the PaginateFirestore widget with different values for different queries.

Inihood1 commented 1 year ago

Set State doesn't work on the Paginate firestore. Lets say i have a query of a collection called categories and inside it, a document called "utensils" and a nother called "art". Each of these documents has a nested list of documents and other data. I have a variable called "currentlySelected" that storesthe value of the category the user is currently viewing. If i load up the paginate firestore with the initial value as "utensils", it works. If a user presses a button and i use setstate to change the value of currentlySelected to "art", the data shown is still the same from the previous category. The variable in the query doesn't get changed dynamically.

Did you solve it?