Ferhat Ismayilov
Ferhat Ismayilov

Reputation: 273

Flutter Algolia Search Pagination

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

Answers (1)

Kamran Ramzan
Kamran Ramzan

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

Related Questions