Make
π Description
Generate various project files and components. The make command is the primary code generation tool in Gexd CLI, offering powerful scaffolding capabilities for Flutter projects with GetX and Clean Architecture patterns.
βοΈ Usage
gexd make <subcommand> [<name>] [options]π Available Subcommands
ποΈ Core Components
Description: Generate complete screen components (controller, view, binding)
gexd make screen LoginPage
gexd make screen UserProfile --type withState --has-modelDescription: Generate controller files for state management
gexd make controller Auth
gexd make controller User --type withStateDescription: Generate view files (UI components)
gexd make view Login
gexd make view UserProfile --on authDescription: Generate binding files for dependency injection
gexd make binding Auth
gexd make binding Core --location coreπ Data Layer
Description: Generate type-safe model files from JSON sources with advanced features
gexd make model User --file assets/user.json
gexd make model Product --url https://api.example.com/products/1
gexd make model User --immutable --copyWith --relationships-in-folderDescription: Generate repository files for data access layers
gexd make repository User --type crud --interface
gexd make repository Api --on data/repositoriesDescription: Generate service files for business logic
gexd make service Auth
gexd make service Payment --on servicesDescription: Generate provider files for data sources
gexd make provider Api
gexd make provider Local --on data/providersποΈ Architecture Components
Description: Generate entity files for domain layer
gexd make entity User
gexd make entity Product --on domain/entitiesDescription: Generate interface files for contracts and abstractions
gexd make interface User --type crud
gexd make interface Payment --on interfacesDescription: Generate custom exception classes
gexd make exception Auth
gexd make exception Validation --on core/exceptionsDescription: Generate middleware files for request/response handling
gexd make middleware Auth
gexd make middleware Logging --on core/middlewareπ οΈ Utility Components
Description: Generate reusable widget components
gexd make widget CustomButton
gexd make widget UserCard --location sharedDescription: Generate utility helper classes
gexd make util DateUtils
gexd make util ValidationUtils --on core/utilsDescription: Generate constant definition files
gexd make constant ApiConstants
gexd make constant AppConstants --on core/constantsπ― Command Categories
π± UI Components
screen- Complete screen with controller, view, bindingview- UI view componentswidget- Reusable widget components
π§ State Management
controller- State controllersbinding- Dependency injection bindingsmiddleware- Request/response middleware
π Data Management
model- Data models with serializationrepository- Data access repositoriesservice- Business logic servicesprovider- Data source providers
ποΈ Architecture
entity- Domain entitiesinterface- Contract abstractionsexception- Custom exceptions
π οΈ Utilities
util- Helper utilitiesconstant- Application constants
π Common Usage Patterns
π± Complete Feature Generation
# Generate a complete user management feature
gexd make screen UserProfile --type withState --has-model
gexd make model User --file assets/user.json --relationships-in-folder
gexd make repository User --type crud --interface
gexd make service User --on auth/services
gexd make binding User --location screen --on-screen user_profileποΈ Clean Architecture Setup
# Domain layer
gexd make entity User --on domain/entities
gexd make interface User --on domain/repositories
# Data layer
gexd make model User --file user.json --on data/models
gexd make repository User --on data/repositories
gexd make provider User --on data/providers
# Presentation layer
gexd make screen UserProfile --on presentation/pages
gexd make controller User --on presentation/controllersπ API Integration Workflow
# 1. Generate model from API
gexd make model Product --url https://api.store.com/products/1
# 2. Create data access layer
gexd make repository Product --type crud --interface
gexd make provider Api --on data/providers
# 3. Business logic layer
gexd make service Product --on services
# 4. UI layer
gexd make screen ProductList --type withState --model Product
gexd make widget ProductCard --location sharedβοΈ Global Options
Most make subcommands support these common options:
π Organization
--on <path>- Specify subdirectory for generated files--force- Force overwrite existing files without prompting
π¨ Customization
--type <type>- Specify component type/style--template <template>- Choose generation template--style <style>- Select code generation style
π§ Features
--interface- Generate with interface abstraction--immutable- Create immutable data structures--copyWith- Add copy methods for state updates
π‘ Pro Tips
π― Best Practices
Start with Architecture: Generate entities and interfaces first
Use
--onfor Organization: Keep related files in subdirectoriesEnable Interfaces: Use
--interfacefor better testabilityForce During Development: Use
--forcefor rapid iteration
π Efficiency Tips
Batch Generation: Generate related components together
Template Reuse: Save commonly used flag combinations
API-First Development: Generate models from live APIs
Relationship Management: Use
--relationships-in-folderfor complex models
π§ Advanced Workflows
Feature-Based: Group components by feature using
--onLayer-Based: Organize by architectural layers
Test-Driven: Generate interfaces first for better testing
Iterative: Start simple, add features with
--force
π Documentation Links
For detailed documentation on each subcommand, click the links above or visit:
Screen Command - Complete UI component generation
Model Command - Advanced data model creation
Repository Command - Data access layer patterns
Service Command - Business logic organization
Widget Command - Reusable UI components
Generated automatically by gexd_doc
Last updated