Skip to content
pubscout

reactive_forms

18.2.2, released 11 months ago by an unverified publisher

Model-driven form handling and validation inspired by Angular Reactive Forms

WASM-ready
$ flutter pub add reactive_forms
Source repository

What it does

Separates form data models and validation logic from UI widgets using FormGroups, FormArrays, and FormControls. It provides built-in sync and async validators, custom validation hooks, and specialized widgets that bind directly to reactive controls. It tracks validity, touched status, and enabled states across nested form structures.

AI-written summary of version 18.2.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Building complex forms with inter-dependent field validations like password matching
  • Managing dynamic form structures like arrays or groups of inputs that grow at runtime
  • Needing fine-grained control over validation timing, asynchronous checks, or error message display

Skip it when

  • The application only requires a few basic text inputs where standard Flutter Form and TextFormField suffice
  • You prefer pure immutable functional form modeling without Angular-style control objects

Strengths

  • Rich set of pre-built validators, cross-field validation, and async validator support with debounce
  • Comprehensive suite of dedicated reactive widgets (text fields, checkboxes, pickers)
  • Clean separation of form state and business logic from the widget tree

Weaknesses

  • Steep learning curve if not already familiar with Angular's reactive form concepts
  • Requires high minimum Flutter SDK version (>=3.29.0) for the latest release

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

May require intl dependency override if version conflicts occur.

final form = FormGroup({
  'name': FormControl<String>(value: 'John Doe', validators: [Validators.required]),
  'email': FormControl<String>(validators: [Validators.required, Validators.email]),
});

// Access form data
print(form.value);

Alternatives

Packages that do the same job and could replace reactive_forms.

  • formz

    Choose formz for a lightweight, immutable, functional approach often paired with Bloc instead of model-driven control trees.

Works with

Packages commonly used together with reactive_forms: ones it builds on, ones built on it, and its own family.