BondFormState<Success, Failure extends Error> class
Represents the state of a form with its fields and submission status.
- Available Extensions
Constructors
-
BondFormState({required Map<
String, FormFieldState> fields, BondFormStateStatus status = BondFormStateStatus.pristine, Success? success, Failure? failure}) - Creates a BondFormState with the provided parameters.
Properties
- failure → Failure
-
Gets the failure result of the form submission.
no setter
-
fields
→ Map<
String, FormFieldState> -
The map of field names to their corresponding state objects.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → BondFormStateStatus
-
The current status of the form.
final
- success → Success
-
Gets the success result of the form submission.
no setter
Methods
-
copyWith(
{Map< String, FormFieldState> ? fields, BondFormStateStatus? status, Success? success, Failure? failure}) → BondFormState<Success, Failure> - Creates a copy of this BondFormState with optional parameter overrides.
-
error<
T extends FormFieldState< (G> , G>String fieldName) → String? -
Gets the error message for a form field by its
fieldName
. -
get<
T extends FormFieldState< (G> , G>String fieldName) → T -
Gets the state of a form field by its
fieldName
. -
label<
T extends FormFieldState< (G> , G>String fieldName) → String -
Gets the label for a form field by its
fieldName
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
valid<
T extends FormFieldState< (G> , G>String fieldName) → bool -
Check the validity of a form field by its
fieldName
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String fieldName) → FormFieldState - Allows accessing the state of a form field using subscript operator.