flavors_chef 0.2.0
flavors_chef: ^0.2.0 copied to clipboard
Interactive CLI toolkit for setting up Flutter project flavors.
Flavors Chef #
Flavors Chef automates Flutter flavor setup. Generate launcher icons, splash screens, Android product flavors, iOS configurations, and type-safe Dart helpers—all from a single YAML file.
Quick Start #
1. Install #
dart pub global activate flavors_chef
Or add as a dev dependency:
dev_dependencies:
flavors_chef: ^0.1.0
2. Initialize Configuration #
Generate a ready-to-use configuration file:
dart run flavors_chef:init
This creates flavors_chef.yaml in your project root with documented examples for development, staging, and production flavors.
3. Edit Configuration #
Open flavors_chef.yaml and uncomment the flavors you need. The file includes:
- Project defaults (pre-filled from your
pubspec.yaml) - Three example flavors (development, staging, production) with comments
- All available options documented inline
4. Generate Flavors #
Apply your configuration:
dart run flavors_chef:generate
Or use the full command:
flavors_chef --project . --config flavors_chef.yaml
What Gets Generated #
Flavors Chef automatically:
- ✅ Copies assets to
assets/flavors/<flavor>/ - ✅ Updates
pubspec.yamlwith required dependencies - ✅ Generates
flutter_launcher_icons-<flavor>.yamlfiles - ✅ Generates
flutter_native_splash-<flavor>.yamlfiles - ✅ Runs launcher icon and splash screen generators
- ✅ Configures Android product flavors and resources
- ✅ Creates iOS Info.plist overlays
- ✅ Generates Dart helpers in
lib/flavors/
Configuration Example #
project:
app_name: My App
android_application_id: com.example.myapp
ios_bundle_id: com.example.myapp
flavors:
- name: development
app_name: My App Dev
android_application_id: com.example.myapp.dev
ios_bundle_id: com.example.myapp.dev
primary_color_hex: '#6750A4'
icon_source_path: assets/icons/dev_icon.png
splash_image_path: assets/splash/dev_splash.png
launcher_icons:
adaptive_icon_foreground: assets/icons/dev_fg.png
adaptive_icon_background: '#FFFFFF'
native_splash:
color: '#6750A4'
image: assets/splash/dev_splash.png
environment:
API_BASE_URL: https://dev.api.example.com
LOG_LEVEL: debug
Advanced Configuration #
Launcher Icons #
Customize launcher icon generation with any flutter_launcher_icons options:
launcher_icons:
android: true
ios: true
min_sdk_android: 26
adaptive_icon_foreground: assets/icons/fg.png
adaptive_icon_background: '#F5F5F5'
adaptive_icon_monochrome: assets/icons/mono.png
image_path_ios_dark_transparent: assets/icons/dark.png
Native Splash #
Customize splash screens with any flutter_native_splash options:
native_splash:
android: true
ios: true
color: '#6750A4'
color_dark: '#201A2C'
image: assets/splash/splash.png
image_dark: assets/splash/splash_dark.png
android_12:
color: '#6750A4'
image: assets/splash/android12.png
Interactive Mode #
Run without a config file for a guided setup:
flavors_chef --project .
Follow the prompts to configure each flavor interactively.
iOS Setup #
After generating flavors, configure Xcode:
- Open
ios/Runner.xcodeprojin Xcode - Duplicate the
Runnerscheme for each flavor (e.g.,Runner-development) - Create build configurations (
Debug-development,Release-development, etc.) - Point each configuration's
Info.plist Filetoios/FlavorChef/<flavor>.plist - Adjust signing and bundle identifiers per configuration
Then run:
flutter run --flavor development
Features #
- 🎨 Unified Configuration - One YAML file for all flavor settings
- 🚀 Zero Manual Setup - Automatically configures Android and iOS
- 🎯 Type-Safe Helpers - Generated Dart code for runtime flavor access
- 📱 Icon & Splash - Integrated with
flutter_launcher_iconsandflutter_native_splash - 🔧 Flexible - Supports all launcher icon and splash screen options
- 📝 Well-Documented - Generated config includes inline documentation
Commands #
| Command | Description |
|---|---|
dart run flavors_chef:init |
Generate flavors_chef.yaml template |
dart run flavors_chef:generate |
Apply config (uses flavors_chef.yaml by default) |
flavors_chef --project . --config flavors_chef.yaml |
Full command with explicit paths |
flavors_chef --project . |
Interactive mode |
Requirements #
- Flutter SDK
flutter_launcher_icons(auto-added as dev dependency)flutter_native_splash(auto-added as dev dependency)
Contributing #
For local development:
dart pub global activate --source path .
License #
See LICENSE file for details.