FormXField<V> class
FormXField is an immutable class used by FormX to handle each field in the form,
where V
stands for the type used as the value of the form field.
Constructors
-
FormXField.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 setterinherited
- 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
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.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) → FormXField< V> - Updates the value of the field, maintaining all other properties
-
validateItem(
{bool softValidation = false}) → Future< FormXField< V> > - Validates the field.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited