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.