xmartlabs / stock

Dart package for Async Data Loading and Caching. Combine local (DB, cache) and network data simply and safely.
https://pub.dev/packages/stock
Apache License 2.0
74 stars 6 forks source link

Paging Support #41

Open OliverRhyme opened 5 months ago

OliverRhyme commented 5 months ago

Does this library supports paging? Or do we have guidelines for handling paged data?

mirland commented 3 months ago

Hi, Stock is a flexible package, so it supports it. However, you have to send the request number with each request.

To make a request, you have to send a key like await stock.fresh(key);. In your case, that key should contain the page number. For instance, if your request needs an ID, you can use a pair with the page number and the ID, like await stock.fresh(Pair(id, pageNumber));.