XFormController extension

Extension methods for FormController providing more type-safe updates.

The XFormController extension adds methods to FormController to simplify updating the values of various form fields in a type-safe manner.

Example usage:

// Update the value of a text field.
controller.updateText('fieldName', 'new value');

// Update the value of a checkbox field.
controller.updateCheckbox('fieldName', true);

// Toggle a value in a checkbox group.
controller.toggleCheckbox('fieldName', value: 'value', selected: true);

Methods:

on

Methods

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.
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.
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.