flutter_archx

pub package License: MIT

A production-ready CLI tool to scaffold enterprise-grade Flutter projects with a scalable, clean architecture template.

Features

  • πŸ—οΈ Enterprise Architecture β€” Clean Architecture with data, domain, and feature layers
  • ⚑ GetX Integration β€” State management, routing, and dependency injection out of the box
  • 🌐 Dio Networking β€” Pre-configured HTTP client with interceptors and error handling
  • πŸ” Secure Storage β€” FlutterSecureStorage and GetStorage wrappers ready to use
  • 🎨 Theme System β€” Complete theme configuration with colors, typography, and dimensions
  • πŸ“¦ 8 Feature Modules β€” Authentication, Dashboard, Employees, Attendance, Payroll, Leave, Recruitment, Reports
  • 🧩 Shared Components β€” Reusable widgets, dialogs, layouts, and components
  • βš™οΈ Environment Config β€” Dev, Staging, and Production environment support with flavors

Installation

dart pub global activate flutter_archx

Usage

Create a new project

flutter-arch create my_awesome_app

With custom organization

flutter-arch create my_awesome_app --org com.mycompany

Available options

flutter-arch create --help
Option Description Default
--org Organization identifier com.example
--description Project description (auto)
--no-git Skip git initialization false

Generated Architecture

lib/
β”œβ”€β”€ main.dart
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ app.dart
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ bindings/
β”‚   β”œβ”€β”€ config/
β”‚   └── theme/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ constants/
β”‚   β”œβ”€β”€ enums/
β”‚   β”œβ”€β”€ errors/
β”‚   β”œβ”€β”€ exceptions/
β”‚   β”œβ”€β”€ extensions/
β”‚   β”œβ”€β”€ helpers/
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ validators/
β”‚   β”œβ”€β”€ network/
β”‚   β”œβ”€β”€ storage/
β”‚   └── services/
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ datasources/
β”‚   └── repositories/
β”œβ”€β”€ domain/
β”‚   β”œβ”€β”€ entities/
β”‚   β”œβ”€β”€ repositories/
β”‚   └── usecases/
β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ authentication/
β”‚   β”œβ”€β”€ dashboard/
β”‚   β”œβ”€β”€ employees/
β”‚   β”œβ”€β”€ attendance/
β”‚   β”œβ”€β”€ payroll/
β”‚   β”œβ”€β”€ leave/
β”‚   β”œβ”€β”€ recruitment/
β”‚   └── reports/
└── shared/
    β”œβ”€β”€ widgets/
    β”œβ”€β”€ components/
    β”œβ”€β”€ dialogs/
    └── layouts/

Architecture Overview

This CLI generates a project following Clean Architecture principles with GetX for state management:

Layers

  • App β€” Application configuration, routing, theming, and global bindings
  • Core β€” Framework-agnostic utilities, networking, storage, and services
  • Data β€” Models, data sources (remote/local), and repository implementations
  • Domain β€” Business entities, repository contracts, and use cases
  • Features β€” Feature-specific modules with their own bindings, controllers, views, and widgets
  • Shared β€” Reusable UI components shared across features

Requirements

  • Dart SDK >=3.5.0
  • Flutter SDK installed and available in PATH

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

MIT License β€” see LICENSE for details.

Libraries

flutter_archx
flutter_archx β€” Enterprise Flutter Architecture CLI