Skip to content
pubscout

cloud_firestore

7.2.0, released 4 days ago by firebase.google.com

Flutter plugin for Cloud Firestore noSQL database with live synchronization.

Flutter FavoriteWASM-ready
$ flutter pub add cloud_firestore
Source repository

What it does

Provides a client for Cloud Firestore, allowing apps to store, query, and synchronize data in real time with offline support on Android, iOS, web, Windows, and macOS.

AI-written summary of version 7.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a cloud-hosted NoSQL database for your Flutter app.
  • Your application requires real-time data synchronization across clients.
  • You need offline data persistence and access.

Skip it when

  • You require a relational database with complex SQL joins.
  • You are using a non-Firebase backend provider.

Strengths

  • Live synchronization out of the box
  • Built-in offline support for mobile platforms
  • Deep integration with the Firebase ecosystem

Weaknesses

  • Complex querying limitations typical of NoSQL document databases
  • Vendor lock-in to Firebase

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
6

Requires initializing Firebase via firebase_core and configuring Android/iOS native Firebase project settings.

import 'package:cloud_firestore/cloud_firestore.dart';

Future<void> addUser() async {
  CollectionReference users = FirebaseFirestore.instance.collection('users');
  return users
    .add({
      'full_name': 'John Doe',
      'company': 'Google',
      'age': 35
    })
    .then((value) => print("User Added"))
    .catchError((error) => print("Failed to add user: $error"));
}

Alternatives

Packages that do the same job and could replace cloud_firestore.

  • supabase

    Choose if you prefer an open-source Postgres relational database and backend-as-a-service alternative to Firebase.

  • supabase_flutter

    Choose for Flutter-specific integration with Supabase backend and Postgres database.

Works with

Packages commonly used together with cloud_firestore: ones it builds on, ones built on it, and its own family.