arch_wizard 1.0.3
arch_wizard: ^1.0.3 copied to clipboard
A powerful CLI tool to scaffold Flutter clean architecture features...
Arch Wizard π§ββοΈβ¨ #
Effortless Flutter Feature Scaffolding with Clean Architecture #
Arch Wizard is a powerful, flexible command-line tool designed to automate the creation of entire feature modules for Flutter apps β structured according to clean architecture principles. Save time, reduce boilerplate, and maintain consistency across your projects and teams.
β¨ Key Features #
- Automated Scaffolding: Generate a complete feature with domain, data, and presentation layers using a single command.
- Clean Architecture Enforcement: Keep your code modular and maintainable.
- Supports Multiple State Management Solutions: BLoC, Riverpod, GetX, Provider.
- Automatic Dependency Injection Registration: Seamlessly update your
get_itsetup. - Production-Ready Templates: Includes robust error handling and architecture best practices.
- Automatic Global Failure Classes Generation: When creating a feature, Arch Wizard automatically creates the global
Failureclasses andFailureMapperfiles (if they don't exist) in your projectβslib/core/error/directory.
This ensures consistent and reusable error handling across your entire app without manual setup.
π Installation #
Install Arch Wizard globally via Dart's pub tool to use it anywhere:
dart pub global activate arch_wizard
Ensure your PATH includes pub global executables, so the command arch_wizard is recognized.
π Usage #
Step 1: Run the Feature Creation Command #
From the root of your Flutter project, run:
arch_wizard create_feature --name <feature_name> --state <state_management>
Replace <feature_name> with your desired feature name (e.g., login).
Choose your preferred state management from bloc, riverpod, getx, or provider.
Step 2: Example Commands #
# Generate a Login feature using BLoC
arch_wizard create_feature --name login --state bloc
# Generate a Product feature using Riverpod
arch_wizard create_feature --name product --state riverpod
# Generate a Profile feature using GetX
arch_wizard create_feature --name profile --state getx
# Generate a Cart feature using Provider
arch_wizard create_feature --name cart --state provider
Step 3: What Happens? #
- Creates the full directory structure inside:
lib/features/<feature_name>/ - Generates domain, data, and presentation files with appropriate templates.
- Automatically updates your DI file (e.g.,
lib/injection_container.dart) with new imports and registrations.
βοΈ Command Options #
| Option | Alias | Description | Allowed Values | Default |
|---|---|---|---|---|
--name |
-n |
Name of the feature to create | Any valid string (e.g., login) |
β |
--state |
-s |
State management approach | bloc, riverpod, getx, provider |
bloc |
π‘ Tips for Customization #
- Generated templates include clear comments and
TODOs to guide you customizing API calls, UI, and business logic. - Supports multi-layer clean architecture, so you can replace or extend any layer independently.
- Easily integrate with your existing codebase by following the generated file and folder structure.
π License #
Arch Wizard is open source software licensed under the MIT License. See the LICENSE file for details.
Happy coding! π #
Build clean, scalable Flutter apps faster with Arch Wizard.