paginate_firestore 1.0.0-nullsafety.0 copy "paginate_firestore: ^1.0.0-nullsafety.0" to clipboard
paginate_firestore: ^1.0.0-nullsafety.0 copied to clipboard

outdated

A flutter package to simplify pagination with firestore data.

Pagination in Firestore #

All Contributors

pub package style: effective dart License: MIT

Setup #

Use the same setup used for cloud_firestore package (or follow this).

Usage #

In your pubspec.yaml

dependencies:
  paginate_firestore: ^0.3.1

Import it

import 'package:paginate_firestore/paginate_firestore.dart';

Implement it

      PaginateFirestore(
        itemBuilderType: PaginateBuilderType.listView, // listview and gridview
        itemBuilder: (index, context, documentSnapshot) => ListTile(
          leading: CircleAvatar(child: Icon(Icons.person)),
          title: Text(documentSnapshot.data()['name']),
          subtitle: Text(documentSnapshot.documentID),
        ),
        // orderBy is compulsary to enable pagination
        query: Firestore.instance.collection('users').orderBy('name'),
        isLive: true // to fetch real-time data
      )

To use with listeners:

      PaginateRefreshedChangeListener refreshChangeListener = PaginateRefreshedChangeListener();

      RefreshIndicator(
        child: PaginateFirestore(
          itemBuilder: (context, documentSnapshot) => ListTile(
            leading: CircleAvatar(child: Icon(Icons.person)),
            title: Text(documentSnapshot.data()['name']),
            subtitle: Text(documentSnapshot.documentID),
          ),
          // orderBy is compulsary to enable pagination
          query: Firestore.instance.collection('users').orderBy('name'),
          listeners: [
            refreshChangeListener,
          ],
        ),
        onRefresh: () async {
          refreshChangeListener.refreshed = true;
        },
      )

Contributions #

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Contributors ✨ #

Thanks goes to these wonderful people:


Adam Dupuis

💻

Gautham

💻

Hafeez Ahmed

💻

Claudemir Casa

💻

Nikhil27bYt

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

291
likes
0
pub points
95%
popularity

Publisher

verified publishervedartm.com

A flutter package to simplify pagination with firestore data.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

bloc, cloud_firestore, flutter, flutter_bloc, provider

More

Packages that depend on paginate_firestore