Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 2.8 KB

File metadata and controls

72 lines (48 loc) · 2.8 KB

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.

Pro tip: create a bash script that takes the flavor as an argument, and run it when needed.

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


Previous Next
Remote Config via GitHub Gist Dark and Tinted Icons on iOS 18