cloud_firestore_dart_flutterfire library
A bridge from the FlutterFire plugins (firebase_core, firebase_auth) to cloud_firestore_dart.
A Flutter app that initializes Firebase and signs its users in with the official plugins gets a
cloud_firestore_dart instance for the same project and the same user, without copying the options and
without a second sign-in:
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
final FirebaseFirestore firestore = await FlutterFireBridge.firestore();
FlutterFireBridge does the common case. The pieces, for wiring by hand: firebaseOptionsFromFlutterFire and dartAppFor for the app, FlutterFireAuthTokenProvider for the user, and FlutterFireAppCheckProvider for App Check tokens.
firebase_core and firebase_app_dart both export Firebase, FirebaseApp, FirebaseOptions and
FirebaseException: import one of them with a prefix.
Classes
- FlutterFireAppCheckProvider
-
An App Check token provider for
cloud_firestore_dartthat takes the tokens from the officialfirebase_app_checkplugin, or from any source with the same two members. - FlutterFireAuthTokenProvider
-
A token provider for
cloud_firestore_dartthat takes the user and the ID token from the officialfirebase_authplugin. - FlutterFireBridge
-
The common case in one call: a
cloud_firestore_dartinstance for a FlutterFire app and its signed-in user. - IdTokenUser
- What FlutterFireAuthTokenProvider needs of a signed-in user: the id and the ID token.
Functions
-
dartAppFor(
String name, FirebaseOptions options, {PlatformDependencies? dependencies, AuthTokenProvider? authProvider, AppCheckTokenProvider? appCheckProvider}) → FirebaseApp -
The
firebase_app_dartapp callednamewith theoptionsof a FlutterFire app, created on the first call. -
firebaseOptionsFromFlutterFire(
FirebaseOptions options) → FirebaseOptions -
The
firebase_app_dartoptions for the FlutterFireoptions(offirebase_core).