reactive_forms_generator
8.5.0, released 3 months ago by an unverified publisher
Generator for type-safe reactive forms based on data models.
What it does
Generates type-safe form classes, controls, and builders based on annotated model classes to work with the reactive_forms package.
AI-written summary of version 8.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to avoid boilerplate code when building forms with reactive_forms
- You want compile-time safety and type-safe form values instead of handling dynamic maps
Skip it when
- You prefer writing your forms manually without using code generation
- You are not using the reactive_forms package
Strengths
- Eliminates boilerplate string identifiers and manual type casting for form values
- Provides static type checks for form fields
- Supports complex features like form arrays, nested form groups, and freezed models
Weaknesses
- Requires setting up build_runner and code generation steps
- Tight coupling with the reactive_forms ecosystem
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 9
Requires adding build_runner, reactive_forms, and reactive_forms_annotations to your pubspec, and executing code generation via build_runner.
import 'package:reactive_forms_annotations/reactive_forms_annotations.dart';
@Rf()
class Basic {
final String email;
final String password;
Basic({
@RfControl(validators: const [RequiredValidator()]) this.email = '',
@RfControl(validators: const [RequiredValidator()]) this.password = '',
});
}Alternatives
Packages that do the same job and could replace reactive_forms_generator.
- reactive_forms_annotations
Annotations for reactive_forms_generator to generate form models
68Compare - dropdown_search
A simple, reactive, and highly customizable Flutter dropdown with search and multi-mode support.
87Compare - reactive_forms
Model-driven form handling and validation inspired by Angular Reactive Forms
65Compare - password_strength_checker
Generate secure passwords and validate strength with visual feedback and form widgets.
64Compare
Works with
Packages commonly used together with reactive_forms_generator: ones it builds on, ones built on it, and its own family.
- analyzerreactive_forms_generator depends on itPerforms static analysis of Dart code for tool integration and embedding.
- dart_stylereactive_forms_generator depends on itProvides an API and CLI to format Dart source code automatically.
- code_builderreactive_forms_generator depends on itA fluent, builder-based library for generating valid Dart code programmatically.
- buildreactive_forms_generator depends on itPackage for authoring build_runner compatible code generators.
- build_runnerreactive_forms_generator depends on itA build system for Dart code generation and modular compilation.
- source_genreactive_forms_generator depends on itSource code generation builders and utilities for the Dart build system.
- recasereactive_forms_generator depends on itChanges the case of input text to various conventions.