GoogleServicesConfig class

What the console writes for a project. Only the app id, the key and the project id are always there; the rest depend on which products the project has, so they are nullable.

Constructors

GoogleServicesConfig({required String appId, required String apiKey, required String projectId, String? databaseUrl, String? storageBucket, String? messagingSenderId})
const

Properties

apiKey String
final
appId String
final
databaseUrl String?
Null when the project has no Realtime Database. The console writes firebase_url only once one exists, and a project using Firestore or Auth alone never gets one — so its absence is ordinary, not an error. initDatabase is where it has to be present.
final
hashCode int
The hash code for this object.
no setterinherited
messagingSenderId String?
The project number, which is what Firebase calls the messaging sender id. Unused by the C++ SDK on desktop, but FirebaseOptions requires it, and the console writes it — so it is carried rather than invented.
final
projectId String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storageBucket String?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

load([String? path]) GoogleServicesConfig
Parses path, or the default location.
parse(String text, {String source = '<memory>'}) GoogleServicesConfig
resolvePath([String? path]) String

Constants

defaultFileName → const String
envVar → const String
Where to look when no path is given: the environment variable first, then the working directory, which for a deployed bundle is the bundle root.