Closed Aurangseb closed 2 years ago
Hi,
a really useful feature would be the ability to modify the query, e.g. when the user picks a different sort or where condition.
Right now the paginator sticks to the original query even if you update the query and setState() or use the PaginateRefreshedChangeListener, which makes it impossible to use in more complex scenarios.
You can use a key . Something like this
PaginateFirestore(
key:ValueKey<String>(priceQuery),// priceQuery changes from user interaction
@marc-walton thanks for the code. It works. But issue is it will refresh the whole PaginateFirestore widget along with it's header and footer. Not only the builder it self. Hope the project owner will fix this issue.
Hi, a really useful feature would be the ability to modify the query, e.g. when the user picks a different sort or where condition. Right now the paginator sticks to the original query even if you update the query and setState() or use the PaginateRefreshedChangeListener, which makes it impossible to use in more complex scenarios.
You can use a key . Something like this
PaginateFirestore( key:ValueKey<String>(priceQuery),// priceQuery changes from user interaction
hello, i am a novice developer. Can u explain it a bit more?
Hi, a really useful feature would be the ability to modify the query, e.g. when the user picks a different sort or where condition. Right now the paginator sticks to the original query even if you update the query and setState() or use the PaginateRefreshedChangeListener, which makes it impossible to use in more complex scenarios.
You can use a key . Something like this
PaginateFirestore( key:ValueKey<String>(priceQuery),// priceQuery changes from user interaction
hello, i am a novice developer. Can u explain it a bit more?
What didn't you understand?
@marc-walton It is giving me error:
// defining query
Query q = FirebaseFirestore.instance .collection('subcategories').where('category', isEqualTo: widget.category['ID']).orderBy('ID');
changeQuery(){
setState({
q = Firebase.instance.collection('items')...; // changing query
});
}
//in body
PaginateFirebase(
key: ValueKey<String>(q), // **(q) giving error: The Object type Query<Object> can't be assigned to parameter type String**
query: q,
....
)
// calling changeQuery() somewhere in logic .
Can you tell me what I am doing wrong in this code and why is it giving me error?
Thank you for help :)
@marc-walton It is giving me error:
// defining query Query q = FirebaseFirestore.instance .collection('subcategories').where('category', isEqualTo: widget.category['ID']).orderBy('ID'); changeQuery(){ setState({ q = Firebase.instance.collection('items')...; // changing query }); } //in body PaginateFirebase( key: ValueKey<String>(q), // **(q) giving error: Can you tell me what I am doing wrong in this code and why is it giving me error? l Thank you for help : clears s @marc-walton It is giving me error:
// defining query Query q = FirebaseFirestore.instance .collection('subcategories').where('category', isEqualTo: widget.category['ID']).orderBy('ID');
changeQuery(){ setState({ q = Firebase.instance.collection('items')...; // changing query }); }
//in body PaginateFirebase( key: ValueKey
(q), // (q) giving error: The Object type Query query: q, .... ) // calling changeQuery() somewhere in logic .
Can you tell me what I am doing wrong in this code and why is it giving me error? Thank you for help :)
The error clearly states you can't pass Query
Then pass it in the valueKey
Hope I could help you
@marc-walton thank you so much for ur time and help for teaching me a new thing :) u are awesome!
Hope this issue is resolved. Thanks for using the package 🎉. Feel free to reopen if you face this issue.
Hi,
a really useful feature would be the ability to modify the query, e.g. when the user picks a different sort or where condition.
Right now the paginator sticks to the original query even if you update the query and setState() or use the PaginateRefreshedChangeListener, which makes it impossible to use in more complex scenarios.