Skip to content

Flavors and config ​

Three flavors, fully wired ​

FlavorEntrypointApp name suffix
developmentlib/main_development.dart[DEV]
staginglib/main_staging.dart[STG]
productionlib/main_production.dartnone

Android product flavors and iOS schemes come from Very Good CLI, so the three flavors can be installed side by side on one device.

bash
fks run                 # development
fks run staging
flutter run --flavor production -t lib/main_production.dart

Custom flavors (--flavors) only get Dart entrypoints. The generator lists the native steps you still need to do.

AppConfig ​

lib/core/config/app_config.dart holds the per-flavor settings: flavor, app name, API base URL, timeout and crash-reporting DSN. Each main_<flavor>.dart builds one with AppConfig.fromEnvironment(...).

The base URL you gave in the setup questions is the default for each flavor. Override it at build time without touching code:

bash
flutter run --flavor staging -t lib/main_staging.dart \
  --dart-define=API_BASE_URL=https://stg.api.acme.com \
  --dart-define=SENTRY_DSN=https://...

Keep secrets out of git

DSNs, keys and tokens belong in --dart-define values and CI secrets, never in source files.

Released under the MIT License.