easy_init_cli 1.2.6 copy "easy_init_cli: ^1.2.6" to clipboard
easy_init_cli: ^1.2.6 copied to clipboard

A CLI tool to create flutter project and initialize project with boilerplate code

Easy Init CLI #

Pub Version Likes License

easy_init

πŸš€ Overview #

Easy Init CLI is a powerful command-line tool designed to streamline the initialization of Flutter projects. It automatically sets up your project with a well-structured, scalable, and testable architecture, saving you time on boilerplate setup.

Currently, it supports TDD + Clean Architecture, a robust pattern favoured by many professional Flutter developers for its separation of concerns and testability.

✨ Key Features #

  • Automated Project Setup: Instantly generate a complete project structure.
  • Clean Architecture: Follows industry-standard TDD + Clean Architecture principles.
  • Feature Generation: Easily add new features (like Authentication) with a single command.
  • Dependency Management: Automatically adds necessary dependencies and dev-dependencies.
  • Customizable: Generated code is a starting point you can tailor to your needs.

πŸ“¦ Installation #

Install the package globally from the command line:

dart pub global activate easy_init_cli

πŸ› οΈ Usage Guide #

1. Create a New Project #

Generate a new Flutter project with a custom organization domain:

easy create project

Follow the prompts to enter your project name and organization domain (e.g., com.example).

2. Initialize Architecture #

Navigate to your project directory:

cd <your_project_name>

Initialize the project structure:

easy init

You will be prompted to select an architecture. Currently, TDD + Clean Architecture is the supported pattern.

Architecture Selection

3. Create a Feature #

Generate a new feature module following Clean Architecture principles:

easy create feature

Or specify the feature name directly:

easy create feature:<feature_name>

Note: If you name your feature auth or authentication, the CLI will automatically include authentication-related screen files.

4. Run Build Runner #

Simplify running the build_runner for code generation:

easy build

5. Update CLI #

Keep your CLI up to date with the latest features and fixes:

easy update

πŸ—οΈ Architecture #

TDD + Clean Architecture #

This architecture separates the code into three main layers: Data, Domain, and Presentation, ensuring independence and testability.

Project Structure

lib/
β”œβ”€β”€ app.dart                     # Main application widget
β”œβ”€β”€ app_runner.dart              # Application runner configuration
β”œβ”€β”€ main.dart                    # Application entry point
β”œβ”€β”€ common/                      # Reusable components, utilities, and shared logic across features
β”‚   └── widgets/                 # Common UI components
β”œβ”€β”€ core/                        # Core functionalities, infrastructure, and cross-cutting concerns
β”‚   β”œβ”€β”€ api_endpoints/           # API endpoint definitions
β”‚   β”œβ”€β”€ base_usecase/            # Base use case definitions
β”‚   β”œβ”€β”€ config/                  # Application configuration
β”‚   β”œβ”€β”€ dependency_injection/    # Dependency injection setup
β”‚   β”œβ”€β”€ extensions/              # Dart extensions
β”‚   β”œβ”€β”€ failures/                # Custom failure classes for error handling
β”‚   β”œβ”€β”€ network/                 # Network client and handling
β”‚   β”œβ”€β”€ routes/                  # Application routing definitions
β”‚   β”œβ”€β”€ services/                # Core services
β”‚   └── theme/                   # Application theme and colors
└── features/                    # Feature-specific modules, each following clean architecture
    └── <feature_name>/
        β”œβ”€β”€ data/                # Data layer (repositories implementation, data sources, models)
        β”‚   β”œβ”€β”€ data_sources/    # Remote and local data sources
        β”‚   β”œβ”€β”€ models/          # Data transfer objects (DTOs)
        β”‚   └── repositories_impl/# Repository implementations
        β”œβ”€β”€ domain/              # Domain layer (entities, repository interfaces, use cases)
        β”‚   β”œβ”€β”€ entities/        # Core business entities
        β”‚   β”œβ”€β”€ repositories/    # Repository interfaces
        β”‚   └── usecases/        # Business logic (use cases)
        └── presentation/        # Presentation layer (UI, blocs, widgets)
            β”œβ”€β”€ blocs/           # BLoC for state management
            β”œβ”€β”€ screens/         # Screens/Pages
            └── widgets/         # UI components specific to the feature

For a deep dive into this architecture, we recommend Reso Coder's Flutter Clean Architecture Course.

Note: A "Number Trivia" feature is generated by default to demonstrate the architecture's flow. You can use this as a reference or remove it when you start building your core features.

🀝 Contributing #

Contributions are welcome! If you find a bug or have a feature request, please open an issue.

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/my-feature).
  5. Open a Pull Request.

πŸ“„ License #

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

16
likes
130
points
54
downloads

Publisher

unverified uploader

Weekly Downloads

A CLI tool to create flutter project and initialize project with boilerplate code

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

args, dcli, process_run, recase

More

Packages that depend on easy_init_cli