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-idReference 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)
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
| 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. |
web_id | (Optional) Firebase Web App ID. |
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. |
android | Object containing path (image source) and background (hex color). |
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. 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