Firebase.initializeApp() => Is it really needed? #3385
-
I understand that this was done to bring more consistency between all the platforms Sdk's where Firebase can be implemented. But I can't really see the benefit on Flutter and does bring some drawbacks. 1º- It does make more boiler plate (Not a big deal) Taking into account that Flutter aims to be a framework with Native performance, very quick development times and one code for all platforms. I can't see the real benefit of forcing too Before the FlutterFire update this wasn't an issue and implementing Firebase was a breeze with great overall results. Again, I understand trying to be consistent and think it is a great idea. But Flutter shouldn't loose good things in favor of other older platforms. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes it's needed. It allows us to do things like provide
This is the compromise between having one initialiser overall or one per plugin. Either way, you're going to need to do asynchronous work and the decision was made it's best doing it once, vs individually.
You don't have to initialise it up front, you can do it whenever you need to start consuming Firebase. The main use-case here is auth - most people want to know whether the user is authenticated straight away; we can't get around having to request that asynchronously so you'd be doing an async call either way. |
Beta Was this translation helpful? Give feedback.
Yes it's needed. It allows us to do things like provide
currentUser
as a getter when your code is run rather than asynchronously requesting it.This is the compromise between having one initialiser overall or one per plugin. Either way, you're going to need to do asynchronous work and the decision was made it's best doing it once, vs individually.
You don't have to initialise it up front, you can do it whenever you need to start consuming F…