Cleany: Flutter Clean Architecture Generator (Cubit)
Cleany is a powerful command-line interface (CLI) tool designed to streamline the feature creation process in your Flutter projects. It automatically scaffolds the complete directory structure and necessary files for a new feature, strictly adhering to Clean Architecture principles and utilizing Cubit for state management.
Say goodbye to tedious boilerplate creation and focus on your business logic!
✨ Features and Benefits
Cleany ensures your codebase remains consistent, scalable, and testable by instantly generating the following self-contained layers for every new feature:
📦 Clean Architecture Layers Generated
| Layer | Purpose | Components |
|---|---|---|
| ✅ Presentation | Handles UI logic, state management, and displaying data. | cubit, states, pages, widgets |
| ✅ Domain | Contains core business rules and independent abstractions. | entities, repositories (abstract), usecases |
| ✅ Data | Manages data retrieval and storage. | datasources (remote/local), models, repositories |
🛠️ Installation
1. Global Activation (Recommended)
dart pub global activate cleany
2. Update
dart pub global activate cleany
🚀 Usage ti create new feature
cleany <feature_name>
▶️ Basic Feature Generation
cleany auth
📂 Specify a Custom Path
cleany auth -p lib/modules
🔧 Available Options
| Option | Short | Description | Example |
| --------------------------------| -----------------------------------------------------| ----------------------------------
| --path | -p | Defines a custom parent directory. | cleany user -p core/modules |
| --help | -h | Displays the help message. | cleany -h |
| --add_dependencies | -d | add base dependencies. | cleany -h |
| --generate_core | -c | Generate core folders with base class and method. | cleany -h |
💡 Example Output
.
└── lib/
└── features/
└── {feature_name}/
├── data/
│ ├── datasources/
│ │ ├── {feature_name}_local_datasource.dart
│ │ └── {feature_name}_remote_datasource.dart
│ ├── models/
│ │ └── {feature_name}_model.dart
│ └── repositories/
│ └── {feature_name}_repository_impl.dart
├── domain/
│ ├── entities/
│ │ └── {feature_name}_entity.dart
│ ├── repositories/
│ │ └── {feature_name}_repository.dart
│ └── use_cases/
│ └── {feature_name}_use_cases.dart
└── presentation/
├── cubit/
│ ├── {feature_name}_cubit.dart
│ └── {feature_name}_state.dart
├── pages/
│ └── {feature_name}_page.dart
└── widgets/
└── {feature_name}_button_widget.dart
Libraries
- content/core_files/constants/app_colors
- content/core_files/constants/app_enums
- content/core_files/constants/app_images
- content/core_files/di/configure_dependencies
- content/core_files/di/third_part
- content/core_files/errors/failure
- content/core_files/extensions/color_extensions
- content/core_files/extensions/context_extensions
- content/core_files/extensions/string_extensions
- content/core_files/navigation/app_router
- content/core_files/navigation/routes
- content/core_files/network/api_endpoints
- content/core_files/network/dio_client
- content/core_files/network/network_exceptions
- content/core_files/services/local_keys_service
- content/core_files/services/logger_service
- content/core_files/theme/app_text_theme
- content/core_files/theme/app_theme
- content/core_files/theme/cubit/theme_cubit_file
- content/core_files/theme/cubit/theme_state_file
- content/core_files/utils/formatters
- content/core_files/utils/validators
- content/core_files/widgets/loading_widget
- content/features_files/date/base_local_data_source_file
- content/features_files/date/base_remote_data_source_file
- content/features_files/date/model_file
- content/features_files/date/repository_data_file
- content/features_files/domain/entity_domain_file
- content/features_files/domain/repository_domain_file
- content/features_files/domain/use_case_domain_file
- content/features_files/presentation/cubit
- content/features_files/presentation/page
- content/features_files/presentation/state
- content/features_files/presentation/widget
- import_files/extension/ext
- import_files/extension/file_modifier
- import_files/files/features/generate_file_content copy
- import_files/files/features/generate_file_feature_content
- import_files/files/generate_file_core_content
- import_files/folders/create_base_folder_structure
- import_files/folders/create_feature_folder_structure
- import_files/print_help_method