feature_gen_cli 1.3.1 copy "feature_gen_cli: ^1.3.1" to clipboard
feature_gen_cli: ^1.3.1 copied to clipboard

A command-line tool for generating feature modules.

Changelog #

1.3.1 #

Docs #

  • Pub Badge URL Fix — Updated the pub.dev badge image URL in README.md to point to feature_gen_cli.svg instead of the old package name.

1.3.0 #

Improvements #

  • Constructor Initializer Lists — BLoC and Riverpod templates now use explicit initializer lists (_useCase = useCase) instead of this._useCase for constructor parameters, improving readability of generated code.
  • Screen Template — Added presentation/screen/ generation for feature scaffolding.
  • Injector Template — Added lib/core/di/injector.dart generation for dependency injection setup.

1.2.3+1 #

Docs #

  • Pub Badges — Added pub package, license, and pub points badges to README.md.
  • Pubspec Topics — Added topic tags (flutter, cli, code-generation, clean-architecture, architecture) for pub.dev discoverability.

1.2.3 #

Features #

  • List Response Support — Response arrays ([{...}]) are automatically detected and propagated as List<Entity> across all generated layers (entity, model, repository, datasource, usecase, bloc state, and riverpod notifier).

Improvements #

  • Scoped Formattingdart format now targets only the generated feature directory instead of the entire project.

1.2.2 #

Docs #

  • Example Files — Added example/example.dart and example/user_schema.json to demonstrate CLI usage and provide a sample schema for feature generation.

1.2.1 #

Refactor #

  • Package Rename — Renamed the package and executable from feature_gen to feature_gen_cli across all source files, imports, CLI usage messages, and pubspec.yaml.

Docs #

  • Pubspec Metadata — Added repository, homepage, and issue_tracker links to pubspec.yaml.

1.2.0 #

Features #

  • Riverpod Support — Support for generating Riverpod Notifier classes as an alternative to BLoC.
  • Configurable Presentation Layer — New config section in the JSON schema allows choosing between bloc and riverpod.
  • Selective Dependency Management — Only installs the dependencies required for the selected state management (e.g., skips flutter_bloc if using riverpod).
  • Strict Schema Validation — Enforces at least one state management option in the config section.

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 toEntity mapping.
  • 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_runner after generation for Freezed models and JSON serialization.
  • Code formatting — Applies dart format to 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 BaseUseCase abstract class.
  • BLoC generation — Generates BLoC, Event, and State files for each feature.
  • Dynamic package name — Reads the project name from pubspec.yaml for correct import paths in generated files.
  • CLI flags--help and --version support.

Generated Files #

  • data/models/<feature>_model.dart
  • data/repositories/<feature>_repository_impl.dart
  • data/datasources/<feature>_remote_datasource.dart
  • domain/entities/<feature>_entity.dart
  • domain/repositories/<feature>_repository.dart
  • domain/usecases/<method>_usecase.dart
  • presentation/bloc/<feature>_bloc.dart
  • presentation/bloc/<feature>_event.dart
  • presentation/bloc/<feature>_state.dart