Configuration

Configure flavors.yaml in your project root.

Valid Example

flavors:
  dev:
    id: myapp.app.dev
    name: MyApp Dev
    icon:
      ios: assets/icon/icon_dev.png
      android:
        path: assets/icon/icon_android.png
        background: "#E0F9FF"
    firebase: firebase-dev-project-id
  prod:
    id: myapp.app
    name: MyApp
    icon:
      ios: assets/icon/icon.png
      android:
        path: assets/icon/icon_android.png
        background: "#FFFFFF"
    firebase: firebase-prod-project-id

Reference Guide

Global Defaults (Optional)

Global keys are optional. If defined, they serve as defaults for all flavors.

KeyDescription
nameApp Name. Optional. Overridable per flavor.
idBase Bundle ID / Application ID. Optional. Can be a string or a map.
firebaseFirebase config. Optional.
schemeURL scheme for deep links. Optional.
app_linkApp Link domain. Optional.
iconIcon config. Optional.
splashSplash screen config. Optional.
ios_development_teamApple Team ID.
build_runnertrue/false.

Flavors Configuration

Keys inside a specific flavor (e.g. dev, prod).

KeyDescription
nameRequired if not defined globally.
idRequired if not defined globally.
firebaseOptional. Uses global if not defined, otherwise blank.
schemeOptional. Uses global if not defined, otherwise blank.
app_linkOptional. Uses global if not defined, otherwise blank.
iconOptional. Flavor specific override.
splashOptional. Flavor specific override.

Single-Flavor / Default Configuration

If your configuration defines only a single flavor, or if you rely solely on global configurations without specific flavor overrides, kflavor treats the project as a standard, non-flavored Flutter application. In this scenario, the --flavor flag is not required when executing flutter run or flutter build commands.

Configuration Objects

Name

The display name of the application.

Example:

name: "My App"

ID (Bundle/Application ID)

Can be a simple string or a map for platform-specific IDs.

String Example:

id: com.example.app

Map Example:

id:
  android: com.example.app.android
  ios: com.example.app.ios
FieldDescription
androidAndroid Application ID.
iosiOS Bundle Identifier.

Firebase

String Example (Project ID only):

firebase: my-project-id

Object Example (Detailed):

firebase:
  project: my-project-id
  account: "user@example.com"
  web_id: "1:1234567890:web:abcdef"
FieldDescription
projectThe Firebase Project ID.
account(Optional) Email account for Firebase CLI context. Useful for supporting multiple accounts across different flavors.
web_id(Optional) Firebase Web App ID.

Scheme

URL scheme for deep links (e.g. myapp://).

Example:

scheme: myapp

Domain for App Links (Android) and Universal Links (iOS).

Example:

app_link: app.example.com

Icon

Example:

icon:
  ios: assets/icon/ios_icon.png
  android:
    path: assets/icon/android_icon.png
    background: "#FFFFFF"
FieldDescription
iosPath to the iOS icon source image.
androidObject containing path (image source) and background (hex color).

Splash

Example:

splash:
  background: "#FFFFFF"
  icon:
    path: assets/icon/splash_icon.png
    background: "#FFFFFF"
FieldDescription
backgroundHex color for the splash screen background.
icon(Optional) Custom icon for splash. Contains path and background. Uses icon config if not defined.

iOS Development Team

The Apple Team ID used for automatic signing.

Example:

ios_development_team: ABCD1EFG2H

Build Runner

Boolean to toggle generated build runner behaviors (if applicable).

Example:

build_runner: true
← Back: CLI CommandsStart Generating YAML