flutter-config
Use when configuring build flavors, passing environment variables via dart-define-from-file, or setting up stage-specific credentials.
Skill by dhruvanbhalara
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/dhruvanbhalara-flutter-config
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/flutter-config
What's inside
- Skill name
flutter-config- Description
- Use when configuring build flavors, passing environment variables via dart-define-from-file, or setting up stage-specific credentials.
- License
- MIT
- Metadata
- category: app-config · languages: dart · platforms: flutter
- Instructions
- 109 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 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`.
- **Swift Package Manager Integration**: When configuring iOS flavors, Xcode schemes map package dependency configurations automatically. No CocoaPods `Podfile` changes are required for SPM. Ensure all dependency overrides are defined under Package Dependencies inside Xcode Runner project settings.
# 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 flavorFrom dhruvanbhalara/skills, MIT.
More from dhruvanbhalara/skills
- 0.611score
dart-fix-runtime-errors
dhruvanbhalara
Use when diagnosing runtime failures, type cast errors, null check violations, or unhandled asynchronous exceptions in Dart.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
dart-build-cli-app
dhruvanbhalara
Use when creating Dart command-line tools, parsing CLI arguments with args, handling exit codes, or managing child processes.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
dart-logic-patterns
dhruvanbhalara
Use when organizing business logic, implementing algorithmic workflows, or applying Dart data structures and pattern matching.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
dart-memory
dhruvanbhalara
Use when troubleshooting memory leaks, optimizing garbage collection overhead, or disposing streams and listeners in Dart.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-add-widget-preview
dhruvanbhalara
Use when configuring widget previews in Flutter development, testing visual component variations, or isolating widget UI states.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-apply-architecture-best-practices
dhruvanbhalara
Use when structuring Flutter application layers across data, domain, and presentation using Clean Architecture and BLoC.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-bloc
dhruvanbhalara
Use when implementing state management with sealed BLoC classes, registering dependency injection with injectable, or setting up GoRouter listeners.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-bloc-forms
dhruvanbhalara
Use when managing complex form state, synchronous and asynchronous input validation, or form submission transitions in BLoC.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-debugging
dhruvanbhalara
Use when diagnosing Flutter layout issues, inspecting widget rebuilds, setting breakpoints, or tracking down UI rendering anomalies.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-devtools
dhruvanbhalara
Use when profiling CPU performance, tracking memory leaks, inspecting widget trees, or viewing network traffic in Flutter DevTools.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-dio
dhruvanbhalara
Use when configuring HTTP network clients with Dio, adding auth token interceptors, handling retry logic, or caching API responses.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-firebase
dhruvanbhalara
Use when integrating Firebase Authentication, Cloud Firestore, Cloud Messaging, Crashlytics, or Firebase Analytics in Flutter.
SkillBFreshness: B★ 30Claude Code +9
Signals
- Stars
- 30
- Forks
- 4
- Open issues
- 0
- Last commit (this folder)
- Aug 29, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/dhruvanbhalara/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from dhruvanbhalara
- 0.611score
dart-fix-runtime-errors
dhruvanbhalara
Use when diagnosing runtime failures, type cast errors, null check violations, or unhandled asynchronous exceptions in Dart.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
dart-build-cli-app
dhruvanbhalara
Use when creating Dart command-line tools, parsing CLI arguments with args, handling exit codes, or managing child processes.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
dart-logic-patterns
dhruvanbhalara
Use when organizing business logic, implementing algorithmic workflows, or applying Dart data structures and pattern matching.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
dart-memory
dhruvanbhalara
Use when troubleshooting memory leaks, optimizing garbage collection overhead, or disposing streams and listeners in Dart.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-add-widget-preview
dhruvanbhalara
Use when configuring widget previews in Flutter development, testing visual component variations, or isolating widget UI states.
SkillBFreshness: B★ 30Claude Code +9 - 0.611score
flutter-apply-architecture-best-practices
dhruvanbhalara
Use when structuring Flutter application layers across data, domain, and presentation using Clean Architecture and BLoC.
SkillBFreshness: B★ 30Claude Code +9
Cite this page
flutter-config skill. Agent Mart. https://agentmart.dev/skills/dhruvanbhalara-flutter-config (last updated 2026-10-24)