easy_code 0.0.1 easy_code: ^0.0.1 copied to clipboard
This package is a code generator for flutter projects.
Codescript CLI is a tool designed to streamline the process of generating Flutter project components. It provides simple commands to generate various architecture components such as views, viewmodels, repositories, bindings, and use cases, or even set up a full architecture in a matter of seconds. This enhances consistency and speeds up development in Flutter projects.
Codescript #
Features #
- Generate individual components: Easily create views, viewmodels, repositories, bindings, and use cases.
- Full architecture generation: Generate a complete architecture setup with one command.
- Fast and efficient: Automate repetitive tasks, saving time and effort.
Usage #
Once installed, you can use the codescript
commands to generate components directly from your terminal.
Commands #
-
Generate a View:
codescript g view <view_name>
-
Generate a ViewModel:
codescript g viewmodel <viewmodel_name>
-
Generate a Repository:
codescript g repository <repository_name>
-
Generate a Binding:
codescript g binding <binding_name>
-
Generate a Use Case:
codescript g usecase <usecase_name>
-
Generate a Full Architecture (includes view, viewmodel, repository, binding, and use case):
codescript g full <resource_name>
Example #
To generate a full architecture setup for a User
resource, run:
codescript g full user
This command will be generate: #
lib/
└── app/
├── /ui
│ └── /views
│ └── user_view.dart
│ └── user_viewmodel.dart
└── data/
├── repositories/
│ └── user_repository.dart
│ └── user_repository_implementation.dart
└── di/
├── user_binding.dart
└── domain/
└── usecases/
└── user_usecase.dart
Customize Output Paths #
By default, the generated components follow a specific folder structure. You can customize the paths for each component by modifying the codescript.yaml configuration file located at the root of your project. Here’s an example configuration:
```yaml view: path: lib/app/views viewmodel: path: lib/app/viewmodels repository: path: lib/app/repositories binding: path: lib/app/bindings usecase: path: lib/app/usecases ```