cloud_firestore
7.2.0, released 4 days ago by firebase.google.com
Flutter plugin for Cloud Firestore noSQL database with live synchronization.
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.
92Compare - supabase_flutter
Choose for Flutter-specific integration with Supabase backend and Postgres database.
92Compare
Works with
Packages commonly used together with cloud_firestore: ones it builds on, ones built on it, and its own family.
- firebase_corecloud_firestore depends on itFlutter plugin that initializes Firebase and allows multiple Firebase app connections.
- cloud_firestore_webcloud_firestore depends on itThe web implementation of cloud_firestore.
- firebase_messagingSame familyFlutter plugin for Firebase Cloud Messaging to deliver messages on Android, iOS, web, and macOS.
- firebase_messaging_webSame familyWeb implementation of Firebase Cloud Messaging for push notifications.
- firebase_analyticsSame familyFlutter plugin for Google Analytics for Firebase.
- firebase_crashlyticsSame familyFlutter plugin that sends uncaught errors and crash reports to Firebase Crashlytics.
- firebase_authSame familyFlutter plugin for Firebase Authentication enabling passwords, phone numbers, and identity providers.
- firebase_auth_webSame familyWeb implementation of Firebase Authentication for Flutter