BaseBondFormState<Success, Failure extends Error> class abstract

Represents the base state of a form, encapsulating its fields and submission status.

This abstract class provides a structure to manage form states, including the mapping of field names to their corresponding states, and the overall submission status of the form.

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.
Implementers
Available extensions
Annotations

Constructors

BaseBondFormState({required Map<String, FormFieldState> fields, BondFormStateStatus status = BondFormStateStatus.pristine, Success? success, Failure? failure})
Creates an instance of BaseBondFormState with the provided parameters.

Properties

failure → Failure
Retrieves the failure result of the form submission.
no setter
failureResult → Failure?
Stores the failure result of the form submission.
final
fields Map<String, FormFieldState>
A 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
Retrieves the success result of the form submission.
no setter
successResult → Success?
Stores the success result of the form submission.
final

Methods

asyncDropDownField<T>(String fieldName) AsyncDropDownFieldState<T>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the async dropdown field for a specified fieldName.
asyncDropDownItems<T>(String fieldName) Future<List<DropDownItemState<T>>>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the list of dropdown items for a specified fieldName.
asyncDropDownValue<T>(String fieldName) → T

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the selected value of the async dropdown field for a specified fieldName.
asyncHiddenField<T>(String fieldName) AsyncHiddenFieldState<T>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the async hidden field state for a specified fieldName.
asyncHiddenFieldValue<T>(String fieldName) → T

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of an async hidden field for a specified fieldName.
asyncRadioButtonsOf<T>(String fieldName) Future<List<RadioButtonFieldState<T>>>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves a list of RadioButtonFieldState for a specified fieldName.
asyncRadioGroup<T>(String fieldName) AsyncRadioGroupFieldState<T>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the async radio group field for a specified fieldName.
asyncRadioGroupValue<T>(String fieldName) → T

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of an AsyncRadioGroupFieldState for a specified fieldName.
checkbox(String fieldName) CheckboxFieldState<bool>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the checkbox field for a specified fieldName.
checkboxesOf<T>(String fieldName) List<CheckboxFieldState<T>>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves a list of CheckboxFieldState for a specified fieldName.
checkboxGroup<T>(String fieldName) CheckboxGroupFieldState<T>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the checkbox group field for a specified fieldName.
checkboxGroupValue<T>(String fieldName) → T?

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the first selected value of a checkbox group for a specified fieldName.
checkboxSelected<T>(String fieldName, T value) bool

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Checks if a specific value is selected within a checkbox group.
checkboxValue<T>(String fieldName) bool

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of a checkbox field for a specified fieldName.
checkboxValues<T>(String fieldName) Set<T>

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the selected values of a checkbox group for a specified fieldName.
copyWith<State extends BaseBondFormState<Success, Failure>>({Map<String, FormFieldState>? fields, BondFormStateStatus? status, Success? success, Failure? failure}) → State
Creates a copy of this BaseBondFormState with optional parameter overrides.
dateField(String fieldName) DateFieldState

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the date field for a specified fieldName.
dateFieldValue(String fieldName) DateTime?

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of a date field for a specified fieldName.

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the dropdown field for a specified fieldName.

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the list of dropdown items for a specified fieldName.

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the selected value of the dropdown field for a specified fieldName.
error<T extends FormFieldState<G>, G>(String fieldName) String?
Retrieves the error message for a form field by its fieldName.
fileField(String fieldName) FileFieldState

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the file field for a specified fieldName.
fileFieldValue(String fieldName) File?

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of a file field for a specified fieldName.
get<T extends FormFieldState<G>, G>(String fieldName) → T
Retrieves the state of a form field by its fieldName.
hiddenField<T>(String fieldName) HiddenFieldState<T>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the hidden field state for a specified fieldName.
hiddenFieldValue<T>(String fieldName) → T

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of a hidden field for a specified fieldName.
label<T extends FormFieldState<G>, G>(String fieldName) String
Retrieves the label for a form field by its fieldName.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
radioButtonsOf<T>(String fieldName) List<RadioButtonFieldState<T>>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves a list of RadioButtonFieldState for a specified fieldName.
radioGroup<T>(String fieldName) RadioGroupFieldState<T>

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the state of the radio group field for a specified fieldName.
radioGroupValue<T>(String fieldName) → T

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of a RadioGroupFieldState for a specified fieldName.
required() → RequiredValues

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the RequiredValues extension for the current form state.
textField(String fieldName) TextFieldState

Available on BaseBondFormState<dynamic, Error>, provided by the FieldBondFormState extension

Retrieves the TextFieldState for a given text field.
textFieldValue(String fieldName) String?

Available on BaseBondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the value of a text field for a specified fieldName.
toString() String
A string representation of this object.
inherited
valid<T extends FormFieldState<G>, G>(String fieldName) bool
Checks 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 the subscript operator.