{"id":15550032,"url":"https://github.com/outdatedguy/firebase_pagination","last_synced_at":"2025-04-15T21:35:08.980Z","repository":{"id":41134663,"uuid":"507415640","full_name":"OutdatedGuy/firebase_pagination","owner":"OutdatedGuy","description":"A flutter package to paginate Realtime Database and Firestore with real-time updates.","archived":false,"fork":false,"pushed_at":"2024-12-13T00:21:41.000Z","size":493,"stargazers_count":15,"open_issues_count":4,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T01:34:41.909Z","etag":null,"topics":["firebase","flutter","package","pagination","realtime"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/firebase_pagination","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OutdatedGuy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["OutdatedGuy"]}},"created_at":"2022-06-25T20:58:00.000Z","updated_at":"2025-03-17T13:04:26.000Z","dependencies_parsed_at":"2023-12-27T21:45:21.611Z","dependency_job_id":"dc5e529e-f79b-45b2-af96-08b5faac031c","html_url":"https://github.com/OutdatedGuy/firebase_pagination","commit_stats":{"total_commits":42,"total_committers":5,"mean_commits":8.4,"dds":0.3571428571428571,"last_synced_commit":"0342346ec50ead03f5655bec366bc474439aa2df"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutdatedGuy%2Ffirebase_pagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutdatedGuy%2Ffirebase_pagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutdatedGuy%2Ffirebase_pagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutdatedGuy%2Ffirebase_pagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OutdatedGuy","download_url":"https://codeload.github.com/OutdatedGuy/firebase_pagination/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249158187,"owners_count":21222074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","flutter","package","pagination","realtime"],"created_at":"2024-10-02T13:47:32.916Z","updated_at":"2025-04-15T21:35:08.958Z","avatar_url":"https://github.com/OutdatedGuy.png","language":"Dart","readme":"# Firebase Pagination\n\nA simple and effective way to **Paginate** Firebase related data.\n\n[![pub package][package_svg]][package]\n[![GitHub][license_svg]](LICENSE)\n\n[![GitHub issues open][issues_svg]][issues]\n[![GitHub issues closed][issues_closed_svg]][issues_closed]\n\n\u003chr /\u003e\n\n|            Realtime Database             |          Firestore           |\n| :--------------------------------------: | :--------------------------: |\n| ![RealtimeDB Ascending Pagination Demo]  | ![Firestore Pagination Demo] |\n| ![RealtimeDB Descending Pagination Demo] |                              |\n\n## Features\n\n- `FirestorePagination` to simplify paginating firestore collections.\n- `RealtimeDBPagination` to simplify paginating realtime database nodes.\n- Get live updates when new data is added using `isLive` property.\n- Get realtime changes on already loaded data.\n- Descending pagination for `RealtimeDBPagination`.\n\n## Getting started\n\n#### Add to Dependencies\n\n```yaml\nfirebase_pagination: ^4.1.0\n```\n\n#### Import the package\n\n```dart\nimport 'package:firebase_pagination/firebase_pagination.dart';\n```\n\n## Usage\n\n#### Simplest Firestore Pagination\n\n```dart\nFirestorePagination(\n  query: FirebaseFirestore.instance.collection('scores').orderBy('score'),\n  itemBuilder: (context, docs, index) {\n    final data = docs[index].data() as Map\u003cString, dynamic\u003e;\n\n    // Do something cool with the data\n  },\n),\n```\n\n#### Simplest Firebase Realtime Database Pagination\n\n```dart\nRealtimeDBPagination(\n  query: FirebaseDatabase.instance.ref().child('scores').orderByChild('score'),\n  orderBy: 'score',\n  itemBuilder: (context, dataNodes, index) {\n    final data = dataNodes[index].value as Map\u003cString, dynamic\u003e;\n\n    // Do something cool with the data\n  },\n),\n```\n\n#### For more examples, see the [examples](example/example.md) section.\n\n## How it Works\n\n- A _data listener_ is added to the query with the given limit.\n- Every time the user scrolls to the bottom of the list, the limit is increased.\n- If there are any changes for the loaded data, it will be automatically updated.\n- If `isLive` is true, a _live listener_ is added to fetch data before the first load. (i.e. Newly added data will be automatically loaded)\n- When new data is added, the _data listener_ will be removed and a new _data listener_ will be added with the new limit.\n- Also the _live listener_ will be removed and a new _live listener_ will be added.\n\n## Efficiency \u0026 Performance\n\n- Both `FirestorePagination` and `RealtimeDBPagination` uses maximum of two `stream listeners` to fetch data.\n- Hence it is **performant** and uses **minimum amount of resources**.\n- The listeners are automatically removed when the widget is removed from the widget tree.\n- For fetching data, the widgets uses [this hack](https://stackoverflow.com/a/70645473) to minimize the number of reads from the database.\n\n## Description\n\n|      Property      |                                              Description                                               |         Type         |             Default             |\n| :----------------: | :----------------------------------------------------------------------------------------------------: | :------------------: | :-----------------------------: |\n|      `query`       |                 **The query to use to fetch data from Firestore / Realtime Database.**                 |       _Query_        |                -                |\n|   `itemBuilder`    |                         **The builder to use to build the items in the list.**                         |      _Function_      |                -                |\n| `separatorBuilder` |                            **The builder to use to render the separator.**                             |      _Function_      | `separatorBuilder (package fn)` |\n|      `limit`       |                        **The number of items to fetch from Database at once.**                         |        _int_         |              `10`               |\n|     `viewType`     |                               **The type of view to use for the list.**                                |      _ViewType_      |         `ViewType.list`         |\n|      `isLive`      |                 **Whether to fetch newly added items as they are added to Database.**                  |        _bool_        |             `false`             |\n|   `gridDelegate`   |                               **The delegate to use for the GridView.**                                | _SliverGridDelegate_ |       `crossAxisCount: 2`       |\n|   `wrapOptions`    |                                 **The Wrap widget properties to use.**                                 |    _WrapOptions_     |         `WrapOptions()`         |\n|   `pageOptions`    |                               **The PageView widget properties to use.**                               |    _PageOptions_     |         `PageOptions()`         |\n|     `onEmpty`      |                               **The widget to use when data is empty.**                                |       _Widget_       |         `EmptyScreen()`         |\n|   `bottomLoader`   |                            **The widget to use when more data is loading.**                            |       _Widget_       |        `BottomLoader()`         |\n|  `initialLoader`   |                         **The widget to use when data is loading initially.**                          |       _Widget_       |        `InitialLoader()`        |\n| `scrollDirection`  |                             **The scrolling direction of the ScrollView.**                             |        _Axis_        |             `false`             |\n|     `reverse`      |                      **Whether the ScrollView scrolls in the reading direction.**                      |        _bool_        |             `false`             |\n|    `shrinkWrap`    |                              **Should the ScrollView be shrink-wrapped.**                              |        _bool_        |             `false`             |\n|     `physics`      |                           **The scroll behavior to use for the ScrollView.**                           |   _ScrollPhysics_    |                -                |\n|     `padding`      |                               **The padding to use for the ScrollView.**                               | _EdgeInsetsGeometry_ |                -                |\n|    `controller`    |                             **The controller to use for the ScrollView.**                              |  _ScrollController_  |       ScrollController()        |\n|  `pageController`  |                              **The controller to use for the PageView.**                               |   _PageController_   |        PageController()         |\n|    `descending`    | **Whether the data should be fetched in descending order or not. Only works for RealtimeDBPagination** |        _bool_        |             `false`             |\n\n### If you liked the package, then please give it a [Like 👍🏼][package] and [Star ⭐][repository]\n\n\u003c!-- Badges URLs --\u003e\n\n[package_svg]: https://img.shields.io/pub/v/firebase_pagination.svg?color=blueviolet\n[license_svg]: https://img.shields.io/github/license/OutdatedGuy/firebase_pagination.svg?color=purple\n[issues_svg]: https://img.shields.io/github/issues/OutdatedGuy/firebase_pagination.svg\n[issues_closed_svg]: https://img.shields.io/github/issues-closed/OutdatedGuy/firebase_pagination.svg?color=green\n\n\u003c!-- Links --\u003e\n\n[package]: https://pub.dev/packages/firebase_pagination\n[repository]: https://github.com/OutdatedGuy/firebase_pagination\n[issues]: https://github.com/OutdatedGuy/firebase_pagination/issues\n[issues_closed]: https://github.com/OutdatedGuy/firebase_pagination/issues?q=is%3Aissue+is%3Aclosed\n[RealtimeDB Ascending Pagination Demo]: https://github.com/OutdatedGuy/firebase_pagination/assets/74326345/6f888eac-13c4-422d-a662-0f7bf7f626f8\n[RealtimeDB Descending Pagination Demo]: https://github.com/OutdatedGuy/firebase_pagination/assets/74326345/df101fa2-8a51-4fdf-a900-828abb6dbaee\n[Firestore Pagination Demo]: https://github.com/OutdatedGuy/firebase_pagination/assets/74326345/7c300ae2-49fb-439e-86fc-10be387c56f8\n","funding_links":["https://github.com/sponsors/OutdatedGuy"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutdatedguy%2Ffirebase_pagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutdatedguy%2Ffirebase_pagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutdatedguy%2Ffirebase_pagination/lists"}