StepperFormController<Success, Failure extends Error> mixin

A controller to manage a multi-step form.

The StepperFormController handles the state of a form that is divided into multiple steps, allowing for navigating between steps and handling the combined form state.

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.
Superclass constraints

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 StepperFormState<Success, Failure>
Returns the current state of the form.
getter/setter pairinherited
steps List<StepFormController<dynamic, Error>>
no setter
stopOnFirstError bool
A flag indicating if the validation should stop on encountering the first error.
getter/setter pairinherited

Methods

clear() → void
Clears the form state and resets it to its initial pristine state.
inherited
fields() Map<String, FormFieldState>
Returns the map of field names to their corresponding FormFieldState.
override
next() → void
Moves to the next step in the form.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onFailure(Failure error) → void
Called when form submission fails. Can be overridden.
inherited
onSubmit() Future<Success>
To be implemented by the subclass, detailing what should happen when a form is submitted.
inherited
onSuccess(Success result) → void
Called when the form is successfully submitted. Can be overridden.
inherited
previous() → void
Moves to the previous step in the form.
setError(String fieldName, String? error) → void
Sets an error message for the specified field and updates the form state to invalid.
inherited
submit() Future<void>
Initiates the form submission process.
inherited
toString() String
A string representation of this object.
inherited
updateError(String fieldName, String error) → void
Updates the error message for the specified field and performs additional validation.
inherited
updateValue<T extends FormFieldState<G>, G>(String fieldName, G value) → void
Updates the field value and status.
inherited
validate() → void
Validates all fields in the form.
inherited

Operators

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