FlutterFire Config with Multiple Flavors (Shell Script)

Did you know?

If your Flutter app uses multiple flavors, you can use the FlutterFire CLI to generate the config files for each flavor.

FlutterFire Config with Multiple Flavors

Here’s what each argument does:

  • --project: The Firebase project to use (note: pass the project ID, not the alias).
  • --out: Output path for the Firebase config file.
  • --ios-bundle-id: iOS app’s bundle ID. Find it in Xcode under Runner > General > Identity > Bundle Identifier.
  • --ios-out: Output path for the iOS GoogleService-Info.plist.
  • --android-package-name: Android app’s package name (found as applicationId in android/app/build.gradle).
  • --android-out: Output path for the Android google-services.json.

Pro Tip: Create a Shell Script

To simplify the setup, here's a sample shell script that takes the flavor as an argument:

To use this script:

  • Copy it to the root of your project
  • Update the project, ios-bundle-id, and android-package-name for your app.
  • Run it and follow the interactive prompts

This is only a small part of the Flutter app flavoring process.

For all the details, check my latest course. 👇

Want More?

Invest in yourself with my high-quality Flutter courses.

Flutter Foundations Course

Flutter Foundations Course

Learn about State Management, App Architecture, Navigation, Testing, and much more by building a Flutter eCommerce app on iOS, Android, and web.

Flutter & Firebase Masterclass

Flutter & Firebase Masterclass

Learn about Firebase Auth, Cloud Firestore, Cloud Functions, Stripe payments, and much more by building a full-stack eCommerce app with Flutter & Firebase.

The Complete Dart Developer Guide

The Complete Dart Developer Guide

Learn Dart Programming in depth. Includes: basic to advanced topics, exercises, and projects. Last updated to Dart 2.15.

Flutter Animations Masterclass

Flutter Animations Masterclass

Master Flutter animations and build a completely custom habit tracking application.