ReactiveField<T> class

A reactive, observable form field that exposes its current value, error message and validity through ValueNotifiers.

Unlike the imperative Form/FormTextField wrappers, ReactiveField is fully reactive: listeners react to value and error changes without manual setState calls.

Constructors

ReactiveField(T initial, {List<FormFieldValidator<String>> validators = const []})

Properties

currentError → String?
The current field error, or null.
no setter
error → ValueListenable<String?>
Observable error message, or null when the field has no error.
no setter
hashCode → int
The hash code for this object.
no setterinherited
initial → T
Initial value of the field.
final
isEmpty → bool
Whether the field is non-empty (value is not whitespace).
no setter
isValid → bool
Whether the field currently satisfies all validators.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validators → List<FormFieldValidator<String>>
Validation rules applied to the raw string value.
final
value → ValueListenable<T>
Observable stream of the current value.
no setter

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setError(String? message) → void
Sets the error without touching the value (e.g. from a server response).
toString() → String
A string representation of this object.
inherited
update(T next) → void
Sets the field value and re-validates.

Operators

operator ==(Object other) → bool
The equality operator.
inherited