flx_cli 1.0.2
flx_cli: ^1.0.2 copied to clipboard
A powerful Flutter Clean Architecture CLI tool for generating scalable project structures with GetX/BLoC state management, Freezed models, and comprehensive boilerplate code.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.2 - 2024-01-15 #
π API Documentation #
- Comprehensive Dartdoc Comments: Added detailed documentation for all public API elements
- FlxCli Class: Complete documentation with usage examples and command descriptions
- FileGenerator Class: Documented all public methods including
generateFeature
,generateScreen
,generateModel
,generateUseCase
,generateRepository
- TemplateGenerator Class: Added documentation for template generation methods and utility functions
- ConfigModel Class: Documented configuration loading and JSON handling
- Utility Methods: Added documentation for naming convention helpers (
toCamelCase
,toPascalCase
,toSnakeCase
) - String Extension: Documented the
capitalize()
helper method
π§ Code Quality Improvements #
- Linter Rules: Added
public_member_api_docs
lint rule to enforce documentation coverage - Additional Rules: Added
prefer_single_quotes
andavoid_print
for better code quality - pub.flutter-io.cn Score: Significantly improved documentation coverage from 0% to 20%+ for better pub.flutter-io.cn score
π― pub.flutter-io.cn Optimization #
- API Coverage: Documented 20+ public API elements to meet pub.flutter-io.cn documentation requirements
- Examples: Added comprehensive usage examples throughout the documentation
- Type Safety: Improved parameter documentation with proper type annotations
1.0.1 - 2024-01-15 #
π Documentation Updates #
- README.md: Updated installation commands to use
flx_cli
package name - Documentation Site: Complete documentation available at https://flx-doc.netlify.app
- Package References: All documentation updated to reflect correct package name
- Installation Guide: Fixed all activation commands throughout documentation
π§ Package Updates #
- Package Name: Changed from
flx
toflx_cli
(original name was taken) - Import Statements: Updated all internal imports to use
flx_cli
- pub.flutter-io.cn Links: Updated badge and installation instructions
1.0.0 - 2024-01-15 #
π Initial Release #
β¨ Features
- Clean Architecture Generator: Complete Clean Architecture structure with data, domain, and presentation layers
- State Management Support:
- GetX controllers with reactive state management
- BLoC pattern with events, states, and business logic
- Code Generation Integration:
- Freezed models for immutable data classes
- Equatable support for value equality
- JSON serialization with json_annotation
- Feature Generation: Full feature generation with all architectural layers
- Individual Component Generation:
- Models with Freezed/Equatable options
- Repositories with implementation
- Use cases for business logic
- Screens with state management
- Configuration System:
.flxrc.json
configuration file- Customizable state manager selection
- Toggleable Freezed/Equatable usage
- Author name configuration
π οΈ Commands
flx config init
- Initialize configuration fileflx config state-manager <type>
- Set default state manager (getx/bloc)flx gen feature <name>
- Generate complete feature with all layersflx gen model <name>
- Generate data modelflx gen screen <name>
- Generate screen with state managementflx gen usecase <name>
- Generate use caseflx gen repository <name>
- Generate repository
ποΈ Architecture
- Data Layer: Remote data sources, models, repository implementations
- Domain Layer: Entities, repository contracts, use cases
- Presentation Layer: Controllers/BLoC, bindings, pages
π¦ Dependencies
args: ^2.4.2
- Command line argument parsingpath: ^1.9.0
- File system path manipulation
π§ͺ Testing
- Comprehensive unit tests for CLI functionality
- Template generation testing
- Configuration management testing
π Documentation
- Complete getting started guide
- Clean Architecture principles
- State management comparisons
- Configuration options
- Best practices and naming conventions
π― Supported Patterns #
- GetX: Reactive state management with dependency injection
- BLoC: Business Logic Component pattern with events and states
- Freezed: Immutable data classes with copy semantics
- Equatable: Value equality for entities and models
π§ Configuration Options #
{
"useFreezed": true,
"useEquatable": false,
"defaultStateManager": "getx",
"author": "Developer"
}
π Generated Structure Example #
lib/features/auth/
βββ data/
β βββ datasources/auth_remote_data_source.dart
β βββ models/auth_model.dart
β βββ repositories/auth_repository_impl.dart
βββ domain/
β βββ entities/auth_entity.dart
β βββ repositories/auth_repository.dart
β βββ usecases/auth_usecase.dart
βββ presentation/
βββ bindings/auth_binding.dart
βββ controllers/auth_controller.dart (GetX)
βββ bloc/ (BLoC)
β βββ auth_bloc.dart
β βββ auth_event.dart
β βββ auth_state.dart
βββ pages/auth_page.dart