BodyConvertible<Success, Failure extends Error> mixin

A mixin that adds functionality to convert form state into a map of key-value pairs suitable for creating a request body.

Superclass constraints
Available extensions

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, Error>
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

body() Map<String, dynamic>
Generates a map from the form state, applying any transformations specified by the fieldTransformers method.
clear() → void
Clears the form state and resets it to its initial pristine state.
inherited
fields() Map<String, FormFieldState>
Returns the map of field names to their corresponding FormFieldState.
inherited
fieldTransformers(TransformersRegistry registry) → void
Registers transformers for specific field types.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSubmit() Future<Success>
To be implemented by the subclass, detailing what should happen when a form is submitted.
inherited
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
toggleCheckbox<T>(String fieldName, {required T value, bool? selected}) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Toggles the value of a specific checkbox within a checkbox group.
toString() String
A string representation of this object.
inherited
update<T extends FormFieldState<G>, G>(String fieldName, G value) → void
Updates the field value and status.
inherited
updateAsyncDropDown<T>(String fieldName, T value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a AsyncDropDownFieldState with a given value.
updateCheckbox(String fieldName, bool value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a CheckboxFieldState with a given value.
updateCheckboxGroup<T>(String fieldName, Set<T> value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a CheckboxGroupFieldState with a given value.
updateDate(String fieldName, DateTime? value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a DateFieldState with a given value.
updateDropDown<T>(String fieldName, T value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a DropDownFieldState with a given value.
updateError(String fieldName, String error) → void
Updates the error message for the specified field and performs additional validation.
inherited
updateFile(String fieldName, File? value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a FileFieldState with a given value.
updateHiddenField<T>(String fieldName, T value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a HiddenFieldState with a given value.
updateRadioButton<T>(String fieldName, T value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a RadioButtonFieldState with a given value.
updateRadioGroup<T>(String fieldName, T value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a RadioGroupFieldState with a given value.
updateText(String fieldName, String? value) → void

Available on FormController<dynamic, Error>, provided by the XFormController extension

Updates a TextFieldState with a given value.
validate() → void
Validates all fields in the form.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited