riverpod_infinite_scroll
riverpod_infinite_scroll copied to clipboard
How we can change the firstPageKey to reevaluate query?
Imagine that you are using the same widget to render a list of items, but you want to apply one filter to the list, so that it refetches again the items, but with the updated query. In my case the filters (and pagination) are treated in the firstPageKey
.
The problem resides in that when I rebuild the widget passing another filters to the firstPageKey
, since the StateNotifierProvider is already alive, it does not update its values, since they are declared once when building the initial state (on super
constructor). How we could be the best way to solve this problem? Refreshing the provider?