feat: new next_page signature, query/mutation fn in notifier and safe update in use_updater

This commit is contained in:
Kingkor Roy Tirtho
2023-02-26 13:51:40 +06:00
parent 1ea9370570
commit f2a23b085c
6 changed files with 62 additions and 70 deletions
@@ -61,12 +61,9 @@ class _InfiniteQueryPageWidgetState extends State<InfiniteQueryPageWidget> {
throw ClientException(res.statusCode.toString(), res.request?.url);
}
},
nextPage: (lastPage, pages) {
if (pages.isNotEmpty &&
pages.last.products.length < pages[lastPage].limit) {
/// returning [null] will set [hasNextPage] to [false]
return null;
}
nextPage: (lastPage, lastPageData) {
/// returning [null] will set [hasNextPage] to [false]
if (lastPageData.products.length < 10) return null;
return lastPage + 1;
},
initialPage: 0,