flutter_feature_gen 1.0.2
flutter_feature_gen: ^1.0.2 copied to clipboard
A Dart CLI tool to generate clean architecture Flutter features.
🛠️ flutter_feature_gen #
A simple Dart CLI tool to instantly scaffold Clean Architecture feature folders in your Flutter project.
Save time, stay consistent, and generate complete feature modules with one command!
🚀 Installation #
Install it globally via pub.dev:
dart pub global activate flutter_feature_gen
Make sure Dart's pub global bin is in your PATH (usually ~/.pub-cache/bin).
If not, add this to your .bashrc / .zshrc:
export PATH="$HOME/.pub-cache/bin:$PATH"
✅ Usage #
flutter_feature_gen feature_name
This will generate:
lib/features/feature_name/
├── data/
│ ├── datasources/
│ ├── models/
│ └── repositories/
├── domain/
│ ├── entities/
│ ├── repositories/
│ └── usecases/
├── presentation/
│ ├── controller/
│ ├── screens/
│ └── widgets/
Each folder includes boilerplate Dart files (models, repositories, use cases, screens, widgets, etc.).
🧠 Smart Naming #
- Converts
meal-plan,meal_plan, orMeal Plan→MealPlanModel,MealPlanRepository, etc. - Folder:
lib/features/meal_plan/ - Class Names:
MealPlanScreen,MealPlanModel, etc.
💡 Example #
flutter_feature_gen meal-plan
Creates:
lib/features/meal_plan/meal_plan_model.dartmeal_plan_repository.dartmeal_plan_screen.dart- And more...
⚡ Optional: Use cf as Shortcut #
Add this to your .zshrc or .bashrc:
alias cf='flutter_feature_gen'
Then use:
cf workout_tracker
📄 License #
MIT License © 2025 Jamal Sfenjeh