flutter_archkit 0.0.1
flutter_archkit: ^0.0.1 copied to clipboard
An automated multi-flavor configuration CLI tool and package for Flutter projects (Android, iOS, VS Code launch, and Dart ServerConfig).
Flutter ArchKit #
A powerful, automated multi-flavor configuration tool and package for Flutter applications. flutter_archkit automates setting up environment flavors across Android, iOS, VS Code, and Dart entry points with a single YAML configuration file.
Features #
- 🤖 Android Flavor Setup: Automatically configures
productFlavorsanddimensioninandroid/app/build.gradle.kts. - 🍎 iOS Configuration: Generates flavor
.xcconfigfiles, shared.xcschemeschemes, patchesInfo.plistdisplay names, and updates Xcodeproject.pbxprojbuild configurations. - ⚙️ Dart ServerConfig: Generates
lib/core/config/server_config.dartand flavor main entrypoints (lib/main_<flavor>.dart). - 💻 IDE Support: Automatically writes
.vscode/launch.jsonwith debug/profile/release configurations for each flavor. - 🛠️ CLI Tool: Run via
dart run flutter_archkit:setup_flavor.
Getting Started #
Add flutter_archkit to your pubspec.yaml under dev_dependencies or dependencies:
dev_dependencies:
flutter_archkit: ^0.0.1
Or run:
flutter pub add --dev flutter_archkit
Quick Start / Usage #
1. Create flavor.yaml #
Create a flavor.yaml file in your root project directory:
flavors:
dev:
appName: "MyApp Dev"
applicationIdSuffix: ".dev"
baseUrl: "https://dev.api.example.com"
prod:
appName: "MyApp"
baseUrl: "https://api.example.com"
2. Run the CLI Generator #
Run the command to setup all flavor files automatically:
dart run flutter_archkit:setup_flavor
Optionally specify a custom YAML file path:
dart run flutter_archkit:setup_flavor --config=custom_flavor.yaml
Output Structure #
The CLI generator generates/patches the following files:
- 📱
android/app/build.gradle.kts - 🍎
ios/Flutter/Flavors/*.xcconfig - 🍎
ios/Runner.xcodeproj/xcshareddata/xcschemes/*.xcscheme - 🍎
ios/Runner/Info.plist - 🍎
ios/Runner.xcodeproj/project.pbxproj - 🎯
lib/core/config/server_config.dart - 🎯
lib/main_<flavor>.dart - 💻
.vscode/launch.json
License #
This project is licensed under the MIT License - see the LICENSE file for details.