Flutter Dev Staging Prod: Set Up Flavors on Android & iOS

Set up Flutter flavors for dev, staging and prod: Android productFlavors, iOS schemes, per-environment config, and side-by-side installs.

Every serious app needs three environments: dev for daily work against a sandbox backend, staging for testing against production-like data, and prod for real users. In Flutter, the way to get there is flavors — and a proper flutter dev staging prod setup means each flavor gets its own app name, its own bundle/application ID, and its own backend URLs, all installable side by side on one phone. This tutorial wires up all three environments on Android and iOS, with per-flavor Supabase URLs — the piece most flavor guides skip. By the end, flutter run --flavor dev opens a blue-iconed "MyApp Dev" talking to your dev Supabase project, while the store build talks to prod. What you'll learn What flavors actually are: Android productFlavors and iOS schemes/configurations Setting up flutter flavors android with per-flavor application IDs and app names Flutter ios flavor setup : schemes, xcconfig files, and bundle identifiers One codebase, three entry points: main_dev.dart , main_staging.dart , main_prod.dart Per-flavor Supabase URLs with --dart-define and --dart-define-from-file Building each flavor: the exact flutter build commands for APK, AAB, and IPA Installing dev, staging, and prod side by side on the same device Flavors vs --dart-define alone: when you need real flavors Step 1 — Android: productFlavors in the Gradle build Flavors on Android are productFlavors in your app-level build.gradle.kts (Flutter 3.x projects use the Kotlin DSL). Each flavor gets a dimension, an applicationIdSuffix so installs don't collide, and a resValue so the launcher shows a different name — the flutter flavor different app names requirement. Open android/app/build.gradle.kts and add the flavors block inside android { } : android { // ... namespace, compileSdk, defaultConfig ...…

Explore