FormController<Success, Failure extends Error> mixin

A mixin to manage the state and logic of a form.

The mixin defines methods for updating fields, validating the form, and handling form submission.

Type Parameters:

  • Success: The data type that represents the result of a successful form submission.
  • Failure: The error type that extends Error representing the failure cases of form submission.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state BondFormState<Success, Failure>
Returns the current state of the form.
getter/setter pair
stopOnFirstError bool
A flag indicating if the validation should stop on encountering the first error.
getter/setter pair

Methods

clear() → void
Clears the form state and resets it to its initial pristine state.
fields() Map<String, FormFieldState>
Returns the map of field names to their corresponding FormFieldState.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSubmit() Future<Success>
To be implemented by the subclass, detailing what should happen when a form is submitted.
submit() Future<void>
Initiates the form submission process.
toString() String
A string representation of this object.
inherited
update<T extends FormFieldState<G>, G>(String fieldName, G value) → void
Updates the field value and status.
validate() → void
Validates all fields in the form.

Operators

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