AdvancedFormState class

The state of an AdvancedFormController — which fields and subforms it owns, whether the user has changed anything, and whether validation applies.

validating, hasFailedValidation, canSubmit and validationErrors are computed from child fields on every read, so they always reflect the live tree. Only the stored fields take part in ==.

Constructors

AdvancedFormState({bool wasModified = false, List<AdvancedFieldController> fields = const [], Set<AdvancedFormController> subforms = const {}, bool validationEnabled = true, ValidationMode validationMode = ValidationMode.manual})
Creates a new AdvancedFormState.
const

Properties

allFields Iterable<AdvancedFieldController>
This form's fields including every subform's fields.
no setter
canSubmit bool
Whether every field in the tree is valid right now.
no setter
fields List<AdvancedFieldController>
List of all registered fields by this form.
final
hasFailedValidation bool
Whether some field's async validation failed. Clears on the next AdvancedFormController.validate call.
no setter
hashCode int
The hash code for this object.
no setterinherited
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
subforms Set<AdvancedFormController>
Set of registered subforms. Reference equality is assumed.
final
validating bool
Whether async validation is pending or running anywhere in the tree.
no setter
validationEnabled bool
Whether this subtree participates in validation. When false, nothing validates, AdvancedFormController.validate returns true, and fields are excluded from canSubmit and validationErrors. False if any ancestor disabled validation.
final
validationErrors Map<AdvancedFieldController, dynamic>
Every error in the tree, keyed by field.
no setter
validationMode ValidationMode
When fields in this tree validate themselves. Ignores validationEnabled — see AdvancedFieldState.validationMode for the effective mode.
final
wasModified bool
Whether any field value differs from the last registerFields, or any subform was itself modified.
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

Operators

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