feat: infinite query listenable add and cache event stream

This commit is contained in:
Kingkor Roy Tirtho
2023-02-21 12:47:34 +06:00
parent efa2c81505
commit 783a2737b1
5 changed files with 158 additions and 4 deletions
@@ -40,6 +40,15 @@ class _InfiniteQueryPageWidgetState extends State<InfiniteQueryPageWidget> {
appBar: AppBar(
title: const Text('Infinite Query'),
),
floatingActionButton: InfiniteQueryListenable(const ValueKey("products"),
builder: (context, query) {
return FloatingActionButton(
onPressed: () {
query?.fetchNext();
},
child: Text(query?.pages.length.toString() ?? "-69"),
);
}),
body: InfiniteQueryBuilder<PagedProducts, ClientException, String, int>(
const ValueKey("products"),
(page) async {