Flutter Flavors Explained — Dev, Staging, Prod Setup in Flutter (Android & iOS)
Setting up Flutter Flavors is essential for building scalable, production-ready apps. In this video, we walk step-by-step through configuring multiple environments — dev, staging, and production — in your Flutter project.
You’ll learn:
✅ How to organize code using a flavors folder
✅ How to create a FlavorConfig singleton for global environment access
✅ How to use separate entry points (main_dev.dart, main_staging.dart, main_prod.dart)
✅ How to configure productFlavors in build.gradle
✅ How to set up iOS schemes and targets in Xcode
✅ How to set different app names and icons per environment
✅ How to run specific flavors easily in Android Studio
✅ How to avoid leaking dev/test code into production
By the end of the video, you’ll have a fully working flavor setup that makes it simple to build, test, and release apps in different environments.
✅ Build Commands for Flutter Flavors
📱 Android:
flutter run -t lib/main_dev.dart --flavor dev
flutter run -t lib/main_staging.dart --flavor staging
flutter run -t lib/main_prod.dart --flavor prod
📦 Android APK build:
flutter build apk -t lib/main_dev.dart --flavor dev
flutter build apk -t lib/main_staging.dart --flavor staging
flutter build apk -t lib/main_prod.dart --flavor prod
🍏 iOS:
flutter run -t lib/main_dev.dart --flavor dev
flutter run -t lib/main_staging.dart --flavor staging
flutter run -t lib/main_prod.dart --flavor prod
📦 iOS Release build (via Xcode):
Open ios/Runner.xcworkspace
Select the appropriate scheme (Dev / Staging / Prod)
Build or archive from Xcode
👍 Like & Subscribe for more Flutter content!
Contact:
[email protected]