flutter-config
Configure app flavors (dev, staging, prod) with environment-specific settings via dart-define-from-file. Use when setting up build variants, per-flavor Firebase projects, or platform-specific configuration.
What this skill does
# Flavor Architecture
- Define three flavors: `dev`, `staging`, `prod`
- Use a **single `main.dart`** entry point for all flavors
- Pass flavor-specific configuration via `--dart-define-from-file`:
```bash
flutter run --flavor dev --dart-define-from-file=config/dev.json
flutter run --flavor staging --dart-define-from-file=config/staging.json
flutter run --flavor prod --dart-define-from-file=config/prod.json
```
- NEVER create separate `main_dev.dart`, `main_staging.dart`, `main_prod.dart` entry points
# Config JSON Structure
- Store per-flavor JSON config files in a `config/` directory at project root:
```
config/
├── dev.json
├── staging.json
└── prod.json
```
- Example `config/dev.json`:
```json
{
"FLAVOR": "dev",
"BASE_URL": "https://api-dev.example.com",
"APP_NAME": "MyApp Dev",
"ENABLE_LOGGING": "true",
"ENABLE_CRASHLYTICS": "false"
}
```
- NEVER put secrets (API keys, signing credentials) in these JSON files — use CI-injected env vars or `flutter_secure_storage`
- Add `config/*.json` to `.gitignore` if they contain any environment-specific secrets; otherwise commit them for team convenience
# Entry Point Pattern
```dart
// lib/main.dart
void main() {
const flavor = String.fromEnvironment('FLAVOR', defaultValue: 'dev');
AppConfig.init(flavor: Flavor.fromString(flavor));
runApp(const App());
}
```
- Read all compile-time values via `String.fromEnvironment('KEY')` or `bool.fromEnvironment('KEY')`
- Use a sealed `Flavor` enum: `sealed class Flavor { dev, staging, prod }`
- `AppConfig` is a singleton holding flavor, base URL, feature flags, and Firebase config
# Environment Configuration
- Store per-flavor config in a centralized `AppConfig` class:
- `baseUrl` — API endpoint per environment
- `enableLogging` — verbose logging for dev only
- `enableCrashlytics` — disabled in dev
- `appName` — display name per flavor (e.g., "MyApp Dev", "MyApp")
- All values come from the JSON file via `--dart-define-from-file` — NO hardcoded per-flavor logic in Dart code
- NEVER put secrets in the JSON config files — use `flutter_secure_storage` or CI-injected env vars
# Platform-Specific Flavor Setup
## Android
- Define `flavorDimensions` and `productFlavors` in `android/app/build.gradle`:
```groovy
flavorDimensions "environment"
productFlavors {
dev { dimension "environment"; applicationIdSuffix ".dev"; resValue "string", "app_name", "MyApp Dev" }
staging { dimension "environment"; applicationIdSuffix ".staging"; resValue "string", "app_name", "MyApp Staging" }
prod { dimension "environment"; resValue "string", "app_name", "MyApp" }
}
```
## iOS
- Create Xcode schemes for each flavor (Dev, Staging, Prod)
- Use xcconfig files for per-flavor bundle ID, display name, and signing
- Map Flutter flavors to Xcode schemes in `ios/Runner.xcodeproj`
# Firebase Per-Flavor
- Use separate Firebase projects per flavor (dev, staging, prod)
- Place `google-services.json` (Android) and `GoogleService-Info.plist` (iOS) in flavor-specific directories
- Use `flutterfire configure` with `--project` flag for each environment
# Build Commands
```bash
# Development
flutter run --flavor dev --dart-define-from-file=config/dev.json
# Staging
flutter run --flavor staging --dart-define-from-file=config/staging.json
# Production release
flutter build appbundle --flavor prod --dart-define-from-file=config/prod.json --release
flutter build ipa --flavor prod --dart-define-from-file=config/prod.json --release
```
# Rules
- NEVER hardcode environment-specific values (URLs, API keys, feature flags)
- NEVER commit production secrets to the repository
- Every team member MUST be able to run any flavor locally with a single command
- CI/CD pipelines MUST specify both `--flavor` and `--dart-define-from-file` explicitly
- Use a single `main.dart` — NEVER create separate entry points per flavor
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.