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:
- 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.
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.
Follow this guide to install
firebase_core and initialize Firebase if you haven't already.
On the root of your Flutter project, run the following command to install the plugin:
Once complete, rebuild your Flutter application:
Currently, 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
Once installed, you're ready to start using Cloud Firestore in your Flutter Project. View the Usage documentation to get started.