You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a breaking change that we'd like to land as part of our push towards stabilizing the Flutterfire API and authoring integration tests that work across web and mobile (see #40).
Currently the Flutterfire plugins are inconsistent about how you get an instance of the plugin. Some, like firebase_analytics, offer only an anonymous constructor: FirebaseAnalytics(). Others have a static final instance member. Some, like cloud_firestore, have both. The anonymous constructor sometimes takes additional arguments, as in the case of firebase_storage.
The following change is proposed:
All plugins (except core) should have a FirebaseXXX.instance member that uses the default Firebase app.
If the plugin offers optional named constructor arguments such as multiple app support, a FirebaseXXX.instanceFor() factory constructor should be provided.
The method should return the same instance when passed identical arguments.
Anonymous constructors should be deprecated and removed in a subsequent release.