πŸ— 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.

Libraries

generate_structure