🚀 Flutter Clean Architecture VS Code Extension 🚀
Quickly scaffold and maintain Flutter Clean Architecture features right from Visual Studio Code! This extension automates the creation of boilerplate code for new features, including the necessary folder structure for a clean, testable, and maintainable Flutter application.
Note: This project is heavily inspired by the open-source repository Flutter-Clean-Architecture-Starter-Kit-Template.
All credits for the original architecture and structure go to them! ✨
📖 Table of Contents
- Features
- Prerequisites
- Installation
- Usage
- Folder Structure
- Watch the Extension in Action
- Contributing
- License
- Credits & References
✨ Features
- Clean Architecture Scaffolding: Automatically generates
core
, data
, domain
, and presentation
folders (and subfolders) following the Clean Architecture approach.
- Boilerplate Code Creation: Instantly creates essential boilerplate files (e.g., data sources, repositories, use cases, BLoC, pages, etc.) with a single command.
- Detect & Create Core Folder: If your project doesn't already have a
core
folder, the extension creates it for you.
- Customizable Feature Names: You simply provide a feature name, and the extension handles the rest!
- Remove Existing Feature: Quickly remove an existing feature folder once you no longer need it.
🔧 Prerequisites
- Flutter SDK (v3.0 or higher recommended)
- Dart (bundled with Flutter)
- VS Code (latest version recommended)
⚙️ Installation
- Open your Flutter project in VS Code.
- Search Extensions: Open VS Code’s Extensions tab (
Ctrl + Shift + X
/ Cmd + Shift + X
) and search for “Flutter Clean Architecture Starter Kit”.
- Install & Reload: Click install on the extension, then reload VS Code if prompted.
🚀 Usage
Create or Open an Existing Flutter Project in VS Code.
Creating a New Feature
- Open the Command Palette (
Ctrl + Shift + P
/ Cmd + Shift + P
).
- Search for Create new feature (the name of the command in this extension).
- Enter the feature name when prompted.
- 🎉 Voila! Your new feature folder (and
core
folder, if missing) will be generated with all the necessary boilerplate files!
data
domain
presentation
- plus any essential subfolders like
datasources
, models
, entities
, usecases
, screens
, repositories
, etc.
Removing an Existing Feature
Open the Command Palette (Ctrl + Shift + P
/ Cmd + Shift + P
).
- Search for Remove existing feature (the command to delete a feature).
- Enter the feature name you want to remove.
- Confirm when prompted.
- The selected feature folder (e.g.,
lib/features/<featureName>
) will be permanently deleted.
Example
If you run the command “Create New Feature” and type in profile
, you’ll get something like this:
lib/
├── core/
│ ├── connections/
│ ├── databases/
│ ├── errors/
│ └── params/
├── features/
│ └── profile/
│ ├── data/
│ │ ├── datasources/
│ │ ├── models/
│ │ └── repositories/
│ ├── domain/
│ │ ├── entities/
│ │ ├── repositories/
│ │ └── usecases/
│ └── presentation/
│ ├── Widgets/
│ └── screens/
🗂️ Folder Structure
The extension follows the same folder structure as the Flutter-Clean-Architecture-Starter-Kit-Template.
lib/
├── core/
│ ├── connections/
│ ├── databases/
│ ├── errors/
│ └── params/
├── data/
│ ├── datasources/
│ ├── models/
│ └── repositories/
├── domain/
│ ├── entities/
│ ├── repositories/
│ └── usecases/
├── presentation/
│ ├── Widgets/
│ └── screens/
└── main.dart
🤝 Contributing
- Fork the repo at Flutter-Clean-Architecture-Starter-Kit-Vs-Extension.
- Create a new branch for your feature or fix.
- Commit your changes with a descriptive commit message.
- Push to your branch.
- Submit a Pull Request (PR).
We appreciate any contributions that improve this extension—be it bug fixes, documentation, or new features!
⚖️ License
This project is licensed under the MIT License.
It also references and utilizes code structures from the Flutter-Clean-Architecture-Starter-Kit-Template, which is under the MIT License as well.
💡 Credits & References
If you find this extension useful, please consider ⭐ starring the original repo and this one!
Happy coding! 🥳