StepFormController<Success, Failure extends Error> mixin

A mixin to manage the state and navigation of individual steps in a multi-step form.

This mixin provides methods to navigate to the next and previous steps and handles form submission specific to each step.

Type Parameters:

  • Success The type representing a successful result of the form submission.
  • Failure The type representing the failure case, which extends Error.
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 BondFormState<Success, Failure>
Returns the current state of the form.
getter/setter pairinherited
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
dispose() → void
fields() Map<String, FormFieldState>
Returns the map of field names to their corresponding FormFieldState.
inherited
next() Future<void>
Submits the current step and advances to the next step if successful.
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>
Handles the form submission for the current step.
override
onSuccess(Success result) → void
Called when the form is successfully submitted. Can be overridden.
inherited
previous() → void
Navigates to the previous step in the multi-step 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