Firebase Initialization with Multiple Flavors in Dart

 Firebase Initialization with Multiple Flavors in Dart

Did you know?

If your Flutter app has multiple flavors, you can put all the Firebase initialization logic in one file and switch based on the appFlavor.




Note: when you do this, all the Firebase config files are bundled in the final app, which is not ideal.

A better solution is to create three entry points that load the corresponding config file and pass it to the function that performs the actual initialization.

When running, you can use the -t flag to specify the entry point:



This requires a bit more work but is more secure. 👍



 


No comments:

Post a Comment

Note: only a member of this blog may post a comment.

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...