Firebase.initializeApp() => Is it really needed?

Hey Guys I just added this ‘issue’ #3385 to the Github repo of FlutterFire as a really feel that the latest update that forces you to Initialize Firebase has no real benefit and a few drawback. Here I leave the comment I wrote. Would love to here your opinion and If you feel the same way please go and comment to try and reverse the change.


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)
2º- It creates a flash when it changes from the Widget display when it is not Initialize and the first screen the user will see (commented in this issue #3384
3º- It has an impact on start time (very small, but flutter aims to complete with native)

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 Initialize Firebase.

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.

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 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.