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:
- updateText Updates a TextFieldState with a given value.
- updateCheckbox Updates a CheckboxFieldState with a given value.
- updateCheckboxGroup Updates a CheckboxGroupFieldState with a given value.
- toggleCheckbox Toggles the value of a specific checkbox within a checkbox group.
- updateDate Updates a DateFieldState with a given value.
- updateDropDown Updates a DropDownFieldState with a given value.
- updateAsyncDropDown Updates a AsyncDropDownFieldState with a given value.
- updateRadioButton Updates a RadioButtonFieldState with a given value.
- updateRadioGroup Updates a RadioGroupFieldState with a given value.
- updateHiddenField Updates a HiddenFieldState with a given value.
- updateFile Updates a FileFieldState with a given value.
- on
-
- FormController<
dynamic, Error>
- FormController<
Methods
-
toggleCheckbox<
T> (String fieldName, {required T value, bool? selected}) → void -
Available on FormController<
Toggles the value of a specific checkbox within a checkbox group.dynamic, Error> , provided by the XFormController extension -
updateAsyncDropDown<
T> (String fieldName, T value) → void -
Available on FormController<
Updates a AsyncDropDownFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateCheckbox(
String fieldName, bool value) → void -
Available on FormController<
Updates a CheckboxFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateCheckboxGroup<
T> (String fieldName, Set< T> value) → void -
Available on FormController<
Updates a CheckboxGroupFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateDate(
String fieldName, DateTime? value) → void -
Available on FormController<
Updates a DateFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateDropDown<
T> (String fieldName, T value) → void -
Available on FormController<
Updates a DropDownFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateFile(
String fieldName, File? value) → void -
Available on FormController<
Updates a FileFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateHiddenField<
T> (String fieldName, T value) → void -
Available on FormController<
Updates a HiddenFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateRadioButton<
T> (String fieldName, T value) → void -
Available on FormController<
Updates a RadioButtonFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateRadioGroup<
T> (String fieldName, T value) → void -
Available on FormController<
Updates a RadioGroupFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
. -
updateText(
String fieldName, String? value) → void -
Available on FormController<
Updates a TextFieldState with a givendynamic, Error> , provided by the XFormController extensionvalue
.