kFlavor Logo
kFlavor

Configuration

Configure flavors.yaml in your project root.

Valid Example

# -----------------------------
# Global defaults (optional)
# -----------------------------
name: KFlavor                                               # optional, overridable per flavor
id: kflavor.app                                             # optional, base bundle id
# Platform-specific overrides for global id (optional)
#id:
#  android: kflavor.app.android
#  ios: kflavor.app.ios
firebase:                                                   # optional
  project: kflavor-app
  account: "yrp.baps@gmail.com"                             # optional
  web_id: "1:83139990596:web:f65c2cb5692b38e3985811"        # optional
scheme: kflavor                                             # optional
app_link: kflavor.com                                       # optional
# optional icon config
icon:
  ios: assets/icon/icon.png
  android:
    path: assets/icon/icon_android.png
    background: "#FFFFFF"
splash:
  background: "#FFFFFF"
  icon:                                                     # optional, uses icon config if not defined
    path: assets/icon/icon_android.png
    background: "#FFFFFF"
ios_development_team: ABCD1EFG2H

# -----------------------------
# Flavors
# -----------------------------
flavors:
  dev:
    name: KFlavor Dev                                       # required if not defined globally
    id: kflavor.app.dev                                     # required if not defined globally
    firebase:                                               # optional, use global otherwise blank
      project: kflavor-app-dev
      account: "yrp.baps@gmail.com"
      web_id: "1:370962456122:web:75315d74ed8931b0c19f03"
    scheme: kflavor-dev                                     # optional, use global otherwise blank
    app_link: dev.kflavor.com                               # optional, use global otherwise blank
#   flavor specific icon override (optional)
    icon:
      ios: assets/icon/icon_dev.png
      android:
        path: assets/icon/icon_android.png
        background: "#e0f9ff"
    splash:
      background: "#FFFFFF"
      icon:
        path: assets/icon/icon_android.png
        background: "#e0f9ff"

  qa:
    name: KFlavor QA
    id: kflavor.app.qa
    firebase: kflavor-app-dev
    scheme: kflavor-qa
    app_link: qa.kflavor.com
    icon:
      ios: assets/icon/icon_qa.png
      android:
        path: assets/icon/icon_android.png
        background: "#e0f9ff"
    splash:
      background: "#FFFFFF"
      icon:
        path: assets/icon/icon_android.png
        background: "#e0f9ff"

  prod:                                                     # same as global configs

build_runner: true

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)

Global bundle/application id used by Android (applicationId) and iOS (bundle identifier). Can be a 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. See Firebase CLI docs for managing multiple accounts.
web_id(Optional) Firebase Web App ID.
Firebase CLI Reference
# Log in to Firebase
firebase login

# Add multiple accounts to support different flavors
firebase login:add

# List logged-in accounts
firebase login:list

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 (relative to project root).
androidObject containing path (image source) and background (hex color).

Note: Always quote hex strings (e.g. "#e0f9ff") so YAML doesn't treat # as a comment.

For detailed guidelines on preparing your icons, see the Icon Preparation guide.

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. If missing, kflavor falls back to flavor.icon then global icon.

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 YAMLNext: Icon Config →