0

I want to make pages like 1,2,3 from firestore documents. But don't know what to do!

So I need pagination functionality like this :

  • if the total number of documents in the collection is 26 then it should be divided into 3 pages, as 0-9, 11-19, 20- 26 documents
  • when I click on page no 2 it should fetch 11-19 documents.

So here I also need to find how many documents are there so I can make pages (like 1,2,3) from that

What I tried

  • I tried firebase's official doc firebase query cursor
  • I also tried the paginate_firestore plugin (but It is not compatible with my requirement)
  • If I am on the 1st page and go to the 3rd page directly, it should fetch 21-26 records (as per example given above)

What I want

  • for example: when we search in google, at bottom of the page there are pages as (1,2,3 more) so I want similar to this
Chirag Mevada
  • 143
  • 1
  • 1
  • 10
  • Hi, Can you please elaborate your question and tell us what you have tried and what is the output that you are receiving. Provide minimum code, you can read this [article](https://stackoverflow.com/help/how-to-ask) to improve your question. – Zeenath S N Mar 04 '22 at 12:51
  • Check out https://firebase.google.com/docs/firestore/query-data/query-cursors – Frank van Puffelen Mar 04 '22 at 15:26

1 Answers1

0

May be help you paginate_firestore package.

Yasin Ege
  • 605
  • 4
  • 14
  • this plugin is not about what I expect, I want to create page numbers at the bottom of the page as (1, 2, 3, next) and click on page number, it should fetch documents according to that! – Chirag Mevada Mar 04 '22 at 09:07
  • Can you check this https://stackoverflow.com/a/61572813/10187218. I have no idea if that doesn't work either – Yasin Ege Mar 04 '22 at 09:30