jsonFactoryBuilder function

Builder jsonFactoryBuilder(
  1. BuilderOptions options
)

Creates and configures the JsonFactory builder for code generation.

This builder is responsible for scanning all Dart files in the project, finding classes annotated with @jsonModel, and generating a centralized JsonFactory class with type-safe parsing methods.

The builder can be configured via build.yaml:

targets:
  $default:
    builders:
      json_factory_generator:jsonFactoryBuilder:
        options:
          output_path: lib/generated  # Where to place the generated file
          output_file_name: json_factory  # Name of generated file (without .dart)

Implementation

Builder jsonFactoryBuilder(BuilderOptions options) {
  return JsonFactoryBuilder(options);
}