ValueBondFormState extension

Extension methods for BondFormState providing convenience operations.

The ValueBondFormState extension adds methods to BondFormState to simplify retrieving values from form fields. It also includes a method to ensure required field values are not null.

Example usage:

// Retrieve a potentially null value from a text field.
final phoneNumber = state.textFieldValue('phoneNumber');

// Retrieve a non-null value from a required text field.
final requiredPhoneNumber = state.required().textFieldValue('phoneNumber');

Methods:

on

Methods

asyncDropDownValue<T>(String fieldName) → T
Retrieves the selected value of the async dropdown field for a specified fieldName.
checkboxGroupValue<T>(String fieldName) → T?
Retrieves the first selected value of a checkbox group for a specified fieldName.
checkboxSelected<T>(String fieldName, T value) bool
Checks if a specific value is selected within a checkbox group.
checkboxValue<T>(String fieldName) bool
Retrieves the value of a checkbox field for a specified fieldName.
checkboxValues<T>(String fieldName) Set<T>
Retrieves the selected values of a checkbox group for a specified fieldName.
dateFieldValue(String fieldName) DateTime?
Retrieves the value of a date field for a specified fieldName.
Retrieves the selected value of the dropdown field for a specified fieldName.
fileFieldValue(String fieldName) File?
Retrieves the value of a file field for a specified fieldName.
hiddenFieldValue<T>(String fieldName) → T
Retrieves the value of a hidden field for a specified fieldName.
radioGroupValue<T>(String fieldName) → T
Retrieves the value of a RadioGroupFieldState for a specified fieldName.
required() → RequiredValues
Retrieves the RequiredValues extension for the current form state.
textFieldValue(String fieldName) String?
Retrieves the value of a text field for a specified fieldName.