generate_structure 1.0.5
generate_structure: ^1.0.5 copied to clipboard
A CLI tool to generate folder structures (MVVM, MVC, MVP, Clean Architecture, Feature-based) for Flutter projects.
π generate_structure #
Are you tired of repeating the same folder setup every time you start a new Flutter screen or feature?
This simple Dart CLI tool lets you generate clean folder structures for your Flutter project in seconds β MVVM, MVC, MVP, Clean Architecture, or even a simple feature-based layout. All with just one command.
β¨ Features #
- π Generate full project structure or just a feature/screen
- π§± Supports:
- MVVM (Model-View-ViewModel)
- MVC (Model-View-Controller)
- MVP (Model-View-Presenter)
- Clean Architecture
- Simple Feature-Based Layout
- β Interactive prompts β you choose what you want
- β»οΈ Smart β skips existing folders, no duplication
π Installation #
Activate it globally using Dart:
dart pub global activate generate_structure
Then add it to your PATH:
On Mac/Linux:
bash
Copy
Edit
export PATH="$PATH":"$HOME/.pub-cache/bin"
On Windows (PowerShell):
powershell
Copy
Edit
$env:PATH += ";$env:USERPROFILE\AppData\Local\Pub\Cache\bin"
βοΈ Usage
Just run:
bash
Copy
Edit
generate_structure
Then follow the interactive CLI:
Choose between "Whole App" or "Single Feature"
Pick your structure style (MVVM, MVC, MVP, etc.)
(If Feature) Type your feature name (e.g. auth, home, etc.)
Thatβs it β your folder structure is generated π―
π Example Outputs
π· MVVM (Feature: auth)
kotlin
Copy
Edit
lib/
βββ core/
β βββ utils/
β βββ services/
βββ features/
β βββ auth/
β βββ data/
β β βββ models/
β β βββ repo/
β βββ presentation/
β βββ cubit/
β βββ view/
β βββ widgets/
πΆ MVC (Feature: profile)
vbnet
Copy
Edit
lib/
βββ models/
βββ controllers/
βββ views/
β βββ profile/
β βββ widgets/
π’ MVP (Feature: home)
arduino
Copy
Edit
lib/
βββ models/
βββ presenters/
βββ views/
β βββ home/
β βββ widgets/
βͺ Clean Architecture (Feature: orders)
kotlin
Copy
Edit
lib/
βββ features/
β βββ orders/
β βββ domain/
β β βββ entities/
β β βββ repositories/
β β βββ usecases/
β βββ data/
β β βββ datasources/
β β βββ models/
β β βββ repositories/
β βββ presentation/
β βββ bloc/
β βββ pages/
β βββ widgets/
πΈ Feature-Based Simple (Feature: cart)
sql
Copy
Edit
lib/
βββ features/
β βββ cart/
β βββ controller/
β βββ model/
β βββ view/
β βββ widgets/
π Update the Tool
To get the latest version:
bash
Copy
Edit
dart pub global activate generate_structure
β€οΈ Why Use It?
Code organization is not just a preference β it's a productivity boost.
generate_structure helps you start clean and stay consistent from day one.
## π¨βπ» Created By
**Kareem Mahmoud**
π§ [email protected]
π Flutter Developer | Architecture-Driven Engineer | Code Generator Enthusiast | Crafting Scalable UIs & Developer Tools
π I build tools that help Flutter developers build faster and cleaner.