All features

Cloud Firestore for Flutter

Real-time cloud data with Cloud Firestore

Cloud Firestore is a first-class skill: data modeling, real-time streams, cursor pagination, batched writes and security rules, all with a cost model a naive integration gets wrong.

What this feature covers

  • Reads and queries: One-shot reads and bounded queries with orderBy and limit.
  • Real-time streams: AutoDispose stream providers that stop listening when a screen closes.
  • Pagination: Cursor pagination with pageSize + 1, never offset.
  • Counting: query.count() aggregations, never snapshot.size.
  • Writes: Batches and transactions for multi-document changes.
  • Rules and indexes: Security rules and composite indexes committed as part of the deliverable.
  • Testing and cost: Emulator tests, fake_cloud_firestore and the Firestore cost model.

How Flutter Agent Kit implements it

Only the feature firestore service imports cloud_firestore. Everything else reads a global firestoreProvider behind that service, so no FirebaseFirestore.instance appears in a widget, a notifier or a provider body. Real-time data is a StreamProvider.autoDispose.family whose query always carries orderBy plus limit, because an unbounded collection listener is a billing bug.

No Firestore type crosses the service boundary: models are plain Equatable Dart classes with fromJson and toJson, and one mapper converts Timestamps to DateTime. The skill runs on Android, iOS, macOS and web.

Frequently asked questions

Why is an unbounded real-time stream a problem?

A listener that stays alive for the app lifetime re-bills every document it sees. The kit uses autoDispose stream providers with bounded queries, so the listener is released when the screen closes and the read cost stays predictable.

Are security rules included?

Yes. The skill treats security rules and composite indexes as part of the deliverable, not an afterthought, and notes that rules are not filters, so the constraint belongs in the query.

Get Flutter Agent Kit

Flutter Agent Kit ships this as a ready feature skill, together with the AGENTS.md context layer and the rest of the skills. €99.99 one-time, lifetime updates, unlimited personal and commercial projects.

Browse all features included in Flutter Agent Kit.