Cloud Firestore
Notice
This page is archived and might not reflect the latest version of the FlutterFire plugins. You can find the latest information on firebase.google.com:
- https://firebase.google.com/docs/firestore/quickstart
- https://firebase.google.com/docs/firestore/manage-data/add-data
- https://firebase.google.com/docs/firestore/manage-data/transactions
- https://firebase.google.com/docs/firestore/query-data/get-data
- https://firebase.google.com/docs/firestore/query-data/listen
- And throughout https://firebase.google.com/docs/firestore/... Most pages that have code snippets have Flutter examples. If you find a page that's missing Flutter snippets, please file a bug.
#
What does it do?Firestore is a flexible, scalable NoSQL cloud database to store and sync data. It keeps your data in sync across client apps through realtime listeners and offers offline support so you can build responsive apps that work regardless of network latency or Internet connectivity.
#
Installation#
1. Make sure to initialize FirebaseFollow this guide to install firebase_core
and initialize Firebase if you haven't already.
#
2. Add dependencyOn the root of your Flutter project, run the following command to install the plugin:
#
3. Rebuild your appOnce complete, rebuild your Flutter application:
#
4. (optional) Improve iOS & macOS build timesCurrently, the Firestore iOS SDK depends on some 500k lines of mostly C++ code which can take upwards of 5 minutes to build in Xcode. To reduce build times significantly, you can use a pre-compiled version by adding 1 line to your ios/Podfile
inside your Flutter project;
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.15.0'
Add this line inside your target 'Runner' do block in your Podfile, e.g.:
Additionally, ensure that you have upgraded your cocoapods to 1.9.1 or higher:
gem install cocoapods
For more information see this issue: https://github.com/FirebaseExtended/flutterfire/issues/2751
#
Next StepsOnce installed, you're ready to start using Cloud Firestore in your Flutter Project. View the Usage documentation to get started.