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: trueReference Guide
Global Defaults (Optional)
Global keys are optional. If defined, they serve as defaults for all flavors.
| Key | Description |
|---|---|
name | App Name. Optional. Overridable per flavor. |
id | Base Bundle ID / Application ID. Optional. Can be a string or a map. |
firebase | Firebase config. Optional. |
scheme | URL scheme for deep links. Optional. |
app_link | App Link domain. Optional. |
icon | Icon config. Optional. |
splash | Splash screen config. Optional. |
ios_development_team | Apple Team ID. |
build_runner | true/false. |
Flavors Configuration
Keys inside a specific flavor (e.g. dev, prod).
| Key | Description |
|---|---|
name | Required if not defined globally. |
id | Required if not defined globally. |
firebase | Optional. Uses global if not defined, otherwise blank. |
scheme | Optional. Uses global if not defined, otherwise blank. |
app_link | Optional. Uses global if not defined, otherwise blank. |
icon | Optional. Flavor specific override. |
splash | Optional. 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
--flavorflag is not required when executingflutter runorflutter buildcommands.
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
| Field | Description |
|---|---|
android | Android Application ID. |
ios | iOS 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"
| Field | Description |
|---|---|
project | The 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
App Link
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"| Field | Description |
|---|---|
ios | Path to the iOS icon source image (relative to project root). |
android | Object 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"| Field | Description |
|---|---|
background | Hex 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