feature_gen_cli 1.2.0
feature_gen_cli: ^1.2.0 copied to clipboard
A command-line tool for generating feature modules.
Changelog #
1.2.0 #
Features #
- Riverpod Support — Support for generating Riverpod
Notifierclasses as an alternative to BLoC. - Configurable Presentation Layer — New
configsection in the JSON schema allows choosing betweenblocandriverpod. - Selective Dependency Management — Only installs the dependencies required for the selected state management (e.g., skips
flutter_blocif usingriverpod). - Strict Schema Validation — Enforces at least one state management option in the
configsection.
1.1.0 #
Features #
- Nested Object Support — Support for nested JSON objects and lists of objects in both API request models (
params,body,query) and response entities/models. - Recursive Model Generation — Automatically generates nested Freezed models and entities for complex schema structures.
- Enhanced Type Mapping — Improved template logic for handling lists, maps, and custom types during
toEntitymapping. - Root Entity Markers — Added comments to generated entities to clearly identify root objects.
1.0.0 #
Features #
- Feature scaffolding — Generate clean-architecture feature modules from a JSON schema.
- Schema-driven generation — Define API methods (
params,body,query) and response fields in a single JSON file. - Auto dependency management — Automatically checks and installs required packages (
flutter_bloc,freezed,get_it,injectable, etc.). - Build runner integration — Runs
build_runnerafter generation for Freezed models and JSON serialization. - Code formatting — Applies
dart formatto the entire project after generation. - Use-case generation — Generates use-case classes for methods that define params, body, or query fields, along with a shared
BaseUseCaseabstract class. - BLoC generation — Generates BLoC, Event, and State files for each feature.
- Dynamic package name — Reads the project name from
pubspec.yamlfor correct import paths in generated files. - CLI flags —
--helpand--versionsupport.
Generated Files #
data/models/<feature>_model.dartdata/repositories/<feature>_repository_impl.dartdata/datasources/<feature>_remote_datasource.dartdomain/entities/<feature>_entity.dartdomain/repositories/<feature>_repository.dartdomain/usecases/<method>_usecase.dartpresentation/bloc/<feature>_bloc.dartpresentation/bloc/<feature>_event.dartpresentation/bloc/<feature>_state.dart