Flutter library for displaying realtime paginated list view or gird view based on screensize.
- Firestore Realtime pagination
- List view style
- Grouped List View
- Waterflow Grid view style
Add dependency
dependencies:
ha_firestore_realtime_paginate: # latest version
HAFirestoreRealtimePaginatedView(
style: ListViewStyle.AutoStyle,
scrollPadding: EdgeInsets.only(bottom: 90),
query: FirebaseFirestore.instance.collection("users")
.where("isDeleted", isEqualTo: false)
.orderBy("addedDate", descending: true),
limit: 10,
builder: (context, snapshot) {
Map<String, dynamic> data = snapshot.data() as Map<String, dynamic>;
return ListTile(
title: Text(data['name'] ?? "no name"),
);
},
emptyWidget: Center(
child: Text("no data found"),
),
)
You can group your listing by passing groupBy
field and your header
widget in the HAFirestoreRealtimePaginatedView
constructor.
HAFirestoreRealtimePaginatedView(
...
groupBy: "addedDate",
header: (groupFieldValue) {
return Container(
color: Colors.white,
child: Text("$groupFieldValue"),
);
},
...
)
You can apply filter for not to include a document in the listing
bool Function(DocumentSnapshot a)? filter
Thanks goes to these wonderful people (emoji key):
Hafeez Ahmed 💻 |
Baig 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
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.