Flutter Clean Architecture Helper
A VS Code extension to streamline creating feature folders, use cases, and repositories in Flutter projects using Clean Architecture.
Features
This extension provides the following functionalities:
- Create Feature Folders: Automatically generates the folder structure for a new feature following Clean Architecture principles.
- Create Use Case: Quickly create a use case within an existing feature.
- Create Domain Repository: Easily add a repository file within the domain layer of a specified feature.
Commands
The following commands are available in the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS) under the Arch category:
1. Create Feature Folders
Command: Create Feature Folders
2. Create Use Case
Command: Create Use Case
3. Create Domain Repository
Command: Create Domain Repository
Description: Creates a repository interface within the domain layer of a specified feature.
Usage:
- Open the Command Palette and run the
Create Domain Repository command.
- Enter the feature name (must already exist).
- Enter the repository name (e.g.,
UserRepo ), and a file with the following template will be created:
import 'package:dartz/dartz.dart';
abstract class UserRepo {
Future<Either<Failure, User>> getUser(int userId);
}
The file will be placed inside either the repo/ or repository/ folder in the domain/ directory, based on the existing folder structure.
Installation
- Go to the Visual Studio Code Marketplace and search for Flutter Clean Architecture Helper.
- Install the extension.
- Open a Flutter project to start using the commands.
Requirements
- Visual Studio Code version 1.60.0 or higher
- TypeScript and Node.js for local development and compilation (for contributors)
Release Notes
Version 1.2.0
- New Command:
Create Domain Repository for generating repositories inside the domain layer.
- Updated folder structure to support both
repo/ and repository/ folder naming conventions in the domain/ directory.
- Improved user flow by consolidating multiple tasks into a single extension for creating feature folders, use cases, and repositories.
Version 1.1.0
- New Command:
Create Use Case
- Merged
Create Feature Folders and Create Use Case functionalities into a single extension for streamlined workflow.
Version 1.0.0
- Initial release with
Create Feature Folders command.
Contributing
Feel free to open issues or submit pull requests to improve the extension.
Support
For any issues or feature requests, please open an issue on the GitHub repository.
Happy coding with Clean Architecture in Flutter! 🚀
| |