By Abdelrahman Saed — Senior Mobile Engineer. Last updated: 2026-08-10.
Build flavors in Flutter allow you to create multiple variants of your app from a single codebase, each with its own bundle identifier, app name, icons, and configuration. Flavors let you run development, staging, and production environments side by side on the same device without conflicts.
Flavors work by defining per-variant build configurations in both the native iOS (Xcode schemes) and Android (Gradle product flavors) layers, then selecting the right configuration from Dart.
Android (in android/app/build.gradle):
flavorDimensions "default"
productFlavors {
dev {
applicationIdSuffix ".dev"
versionNameSuffix "-dev"
}
staging {
applicationIdSuffix ".staging"
}
production {}
}
iOS (Xcode schemes per flavor, with matching build configurations).
Dart entry points — one per flavor:
// lib/main_dev.dart
void main() {
runApp(MyApp(config: DevConfig()));
}
// lib/main_production.dart
void main() {
runApp(MyApp(config: ProductionConfig()));
}
Run with flutter run --flavor dev -t lib/main_dev.dart.
At iStoria, three flavors (dev, staging, production) let engineers test on real devices with the dev variant while QA tests the staging variant against the staging backend — all without uninstalling the production app.
Use build flavors when:
Skip flavors when:
Build flavors change the native build configuration (bundle ID, app name, icons). dart-define passes compile-time values to Dart code without changing the native build. Use flavors when you need different bundle IDs or native configuration; use dart-define when you only need to swap Dart-level values like API URLs.
Three is standard: development (for local coding), staging (for QA against a staging backend), and production (the app store build). Some teams add a fourth (beta) for TestFlight distribution, but that usually overlaps with staging.
Available for hire. Abdelrahman Saed is a Senior Mobile Engineer (Flutter) — open to full-time, fractional, contract, or advisory work. Hire me →
Book a 20-minute call · Download the CV (PDF) · See how I work