Exploring the CLI
Easy Init CLI is a command-line tool that streamlines the creation of Flutter projects. It initializes the project with boilerplate code following a well-structured and maintainable architecture pattern.
Installation
You can install the package from the command line:
dart pub global activate easy_init_cli
Create Project
easy create project
Use this command to create new flutter project. This command will prompt you to provide a project name and organization domain. (example- project name : todo app, organization domain : com.example )
Initialize project
#replace project_name with your project's name
cd project_name
Use the cd command in the terminal to navigate to the project's root directory.
easy init
Use this command to initialize your project with a well-structured architectural pattern. This command will prompt you to select the architecture.
Currently only one architecture pattern is available in easy_init_cli
-
TDD + Clean Architecture
The folder structure of TDD + Clean Architecture looks like this:
To learn more about TDD + Clean architecture refer Reso Coder's website
- MVC architecture pattern creation is temporarly disabled for updations.
Note
- As an initial step, the code for a number trivia feature will be implemented in both architectures.
This will serve as a learning tool to understand the call flow within the chosen architectural pattern.
- The number trivia feature can then be removed when development on the core project functionalities commences.
- All required dependencies and dev dependencies will added automatically, you can add or remove dependencies as per your need.
- The generated files can be customized to suit your specific needs.
Create feature
easy create feature
Use this command to create new Clean architecture feature. this command will promt you to provide a feature name.
OR
easy create feature:feature_name
The screens
folder will contain authentication-related screen files if the feature name is either 'auth' or 'authentication'
Run build-runner
easy build
Use this command to run build runner easly.
Update easy_init_cli
easy update
To update easy_init_cli to latest version run this command
Libraries
- commands/command_list
- commands/create_feature/create_feature
- commands/create_project/create_project
- commands/create_services/create_services
- commands/init/init
- commands/run_build_runner/run_build_runner
- commands/update/update
- core/generator
- core/structure/common_file_contents
- core/structure/export_structure
- core/structure/mvc_getx/file_contents/core_file_contents
- core/structure/mvc_getx/file_contents/mvc_file_contents
- core/structure/mvc_getx/file_contents/mvc_trivia_content
- core/structure/mvc_getx/mvc_getx_structure
- core/structure/structure
- core/structure/tdd_clean_structure/file_contents/file_contents
- core/structure/tdd_clean_structure/file_contents/number_trivia_content
- core/structure/tdd_clean_structure/file_contents/rest_api_file_contents
- core/structure/tdd_clean_structure/file_contents/tdd_common_content
- core/structure/tdd_clean_structure/tdd_clean_structure
- easy_init_logo
- functions/create
- functions/find_current_architecture
- interfaces/args_mixin
- interfaces/command
- interfaces/logging
- utils/shell_utils
- utils/user_input