Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yamauchieduardo opened this issue Dec 16, 2019 · 1 comment
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: core type: documentation Improvements or additions to documentation type: enhancement New feature or request

Comments

@yamauchieduardo
Copy link

yamauchieduardo commented Dec 16, 2019

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?

@yamauchieduardo yamauchieduardo added the type: enhancement New feature or request label Dec 16, 2019
@yamauchieduardo yamauchieduardo changed the title [FlutterFire Plugins] - Lack of pattern when instanciating FlutterFire Plugins [FlutterFire Plugins] - Lack of pattern when instanciating/getting the instance of the FlutterFire plugins Dec 16, 2019
@Ehesp Ehesp added plugin: core type: documentation Improvements or additions to documentation impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) labels Apr 20, 2020
@Salakar
Copy link
Member

Salakar commented Jul 3, 2020

Hey, our firebase_core rework has now landed on master via #2890 - we hope to start publishing preview releases to test out next week which should solve this issue (and others). All plugins will eventually use this new core and therefore provide identical APIs to get their instances (we've done Firestore & Auth already in upcoming PRs).

Thank you for raising this issue 👍

@Salakar Salakar closed this as completed Jul 3, 2020
@firebase firebase locked and limited conversation to collaborators Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact: crowd Affects many people, though not necessarily a specific customer with an assigned label. (P2) plugin: core type: documentation Improvements or additions to documentation type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants