Reputation: 273
I can use Algolia in Flutter project! But can’t make pagination (setHitsPerPage
, setPage
).
can anyone help me?
can you write me an example for pagination?
Upvotes: 1
Views: 858
Reputation: 87
I know it is never too late to answer so i just discovered that i wasn't able to fetch results from Algolia by using 'page', so i checked the code of AGOLIA flutter plugin and came to know that you have to call methods on AlgoliaQuery in chain manner. Following is the example
AlgoliaQuery query =
Constants.algolia.instance.index(Constants.ALGOLIA_MAIN_INDEX);
query
.setHitsPerPage(10)
.setPage(_currentPage)
.getObjects()
.then((algoliaSnapshot) {}
Upvotes: 1