🚀 Flutter Clean Gen
A beautiful, interactive CLI tool to generate complete Flutter Clean Architecture boilerplate code with custom entities and properties.
✨ Features
- 🎨 Beautiful, colorful terminal interface
- 🏗️ Complete Clean Architecture structure
- 📦 Custom entity/model generation with properties
- 🔄 Automatic BLoC pattern setup
- 🎯 Type-safe code generation
- 📱 Ready-to-use UI pages
📦 Installation
Global Installation (Recommended)
dart pub global activate flutter_clean_gen
Run without installing
dart pub global activate --source path .
🎯 Usage
Simply run:
flutter_clean_gen
Follow the interactive prompts:
- Enter feature name: e.g.,
user,product,order - Define properties: Format:
name:type:nullable- Example:
id:String:false - Example:
age:int:true
- Example:
- Confirm generation
Example Session
Enter feature name: user
Property 1: id:String:false
Property 2: name:String:false
Property 3: email:String:false
Property 4: age:int:true
Property 5: done
📁 Generated Structure
lib/features/user/
├── data/
│ ├── datasources/
│ │ ├── user_remote_data_source.dart
│ │ └── user_remote_data_source_impl.dart
│ ├── models/
│ │ └── user_model.dart
│ └── repositories/
│ └── user_repository_impl.dart
├── domain/
│ ├── entities/
│ │ └── user.dart
│ ├── repositories/
│ │ └── user_repository.dart
│ └── usecases/
│ └── user_usecases.dart
└── presentation/
├── bloc/
│ ├── user_bloc.dart
│ ├── user_event.dart
│ └── user_state.dart
└── pages/
└── user_page.dart
📦 Required Dependencies
Add these to your Flutter project's pubspec.yaml:
dependencies:
flutter_bloc: ^8.1.3
equatable: ^2.0.5
dartz: ^0.10.1
http: ^1.1.0
🛠️ Next Steps After Generation
- Create core error classes (
lib/core/error/failures.dart,exceptions.dart) - Create UseCase base class (
lib/core/usecases/usecase.dart) - Set up dependency injection (GetIt, Injectable, etc.)
- Update API endpoints in the data source implementation
📄 License
MIT License