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

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

Retrieves the selected value of the async dropdown field for a specified fieldName.
checkboxGroupValue<T>(String fieldName) → T?

Available on BondFormState<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 BondFormState<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 BondFormState<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 BondFormState<dynamic, Error>, provided by the ValueBondFormState extension

Retrieves the selected values of a checkbox group for a specified fieldName.
dateFieldValue(String fieldName) DateTime?

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

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

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

Retrieves the selected value of the dropdown field for a specified fieldName.
fileFieldValue(String fieldName) File?

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

Retrieves the value of a file field for a specified fieldName.
hiddenFieldValue<T>(String fieldName) → T

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

Retrieves the value of a hidden field for a specified fieldName.
radioGroupValue<T>(String fieldName) → T

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

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

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

Retrieves the RequiredValues extension for the current form state.
textFieldValue(String fieldName) String?

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

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