FormItem<V> class
FormItem is an immutable class used by FormBuilder to handle each field in the form,
where V stands for the type used as the value of the form field.
Constructors
-
FormItem.from({required V? value, required List<
Validator> validators, VoidCallback? onValidationError}) -
Constructor - Notice you can't set isValid from the start,
it will always start as invalid until the first validation happens
factory
Properties
- errorMessage → String?
-
The error message of the field
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isValid → bool
-
The state of the field, valid or invalid - it will always start
as invalid until the first validation happens
final
- onValidationError → VoidCallback?
-
The function to call when the field is invalid
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
validators
→ List<
Validator> -
The list of validators to be applied to the field
final
- value → V?
-
The value of the field, typed V
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateValue(
V newValue) → FormItem< V> - Updates the value of the field, maintaining all other properties
-
validateItem(
{bool softValidation = false}) → Future< FormItem< V> > - Validates the field.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override