instanceFor method Null safety

FirebaseFirestore instanceFor(
  1. {required FirebaseApp app}
)

Returns an instance using a specified FirebaseApp.

Implementation

static FirebaseFirestore instanceFor({required FirebaseApp app}) {
  if (_cachedInstances.containsKey(app.name)) {
    return _cachedInstances[app.name]!;
  }

  FirebaseFirestore newInstance = FirebaseFirestore._(app: app);
  _cachedInstances[app.name] = newInstance;

  return newInstance;
}