Skip to content

[FlutterFire Plugins] - Lack of pattern when instanciating/getting the instance of the FlutterFire plugins #1667

@yamauchieduardo

Description

@yamauchieduardo

In my project, I use some FlutterFire plugins, like:

Firestore
FirebaseAuth
FirebaseStorage
CloudFunctions
FirebaseAnalytics
FirebaseMessaging
Crashlytics
FirebasePerformance

I miss a pattern when instantiating/getting the instance of the plugins:

using default google.json:

Firestore firestore =  Firestore();
FirebaseAuth FirebaseAuth =  FirebaseAuth.instance;
FirebaseStorage firebaseStorage = FirebaseStorage();
CloudFunctions cloudFunctions = CloudFunctions();
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics();
FirebaseMessaging firebaseMessaging = FirebaseMessaging();
Crashlytics crashlytics = Crashlytics();
FirebasePerformance firebasePerformance = FirebasePerformance.instance;

from app:

Firestore firestore =  Firestore(app:app);
FirebaseAuth FirebaseAuth =  FirebaseAuth.fromApp(app);
FirebaseStorage firebaseStorage = FirebaseStorage(app:app);
CloudFunctions cloudFunctions = CloudFunctions(app:app);

Why when using google.json (default) the plugins FirebaseAuth, FirebasePerformance instantiate in a different way?

Wouldn't it be better if every plugin were instantiated in the same way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)plugin: coretype: documentationImprovements or additions to documentationtype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions