instance property

FirebaseFirestore get instance

The instance of the default FirebaseApp and the default database.

Like FlutterFire, it creates the instance on first use, with the default Settings and a memory cache, when instanceFor has not created it yet. Call instanceFor first to give it settings or a persistent cache. Throws the error of FirebaseApp.instance if there is no default app.

await Firebase.initializeApp(options: options);
// Later, anywhere in the program:
final FirebaseFirestore firestore = FirebaseFirestore.instance;

Implementation

static FirebaseFirestore get instance {
  return instanceFor(app: FirebaseApp.instance);
}