I'm trying to implement filtering but i'm having issue refresh the API call with the new filter key
class HistoryStateNotifier extends PagedNotifier<int, Transaction> {
Ref ref;
String selectedFilter;
HistoryStateNotifier({required this.ref, this.selectedFilter = 'all'})
: super(
load: (page, limit) => ref
.watch(apiProvider)
.getTransactions(page, limit, selectedFilter)
.then((value) => value.transactions),
nextPageKeyBuilder: NextPageKeyBuilderDefault.mysqlPagination,
);
void setFilter(String filter) {
selectedFilter = filter;
// what i'm trying to reach is when the setFilter is called,
//the api call should be made again with the new filter
}
}
final historyProvider =
StateNotifierProvider<HistoryStateNotifier, PagedState<int, Transaction>>(
(ref) => HistoryStateNotifier(
ref: ref,
),
);
It seems like you are using riverpod_infinite_scroll.
The developers of that package are not related to this one.
If you have issues, please ask in the riverpod_infinite_scroll repository instead.
Hello,
I'm trying to implement filtering but i'm having issue refresh the API call with the new filter key