NyFormActions class
Helper class for dispatching form actions by name.
Use this in your form class to provide a static actions accessor:
class ProfileForm extends NyFormWidget {
// ...
static NyFormActions get actions => const NyFormActions('ProfileForm');
}
// Then use:
ProfileForm.actions.updateField('username', 'JohnDoe');
ProfileForm.actions.submit(onSuccess: (data) => print(data));
Constructors
- NyFormActions(String formName)
-
const
Properties
Methods
-
clear(
) → void - Clear all form data
-
clearField(
String key) → void - Clear a specific field in the form
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → void - Refresh the form state
-
refreshForm(
) → void - Refresh the form fields
-
setOptions(
String key, dynamic value) → void - Set options for a picker/chip/radio field
-
submit(
{required dynamic onSuccess(dynamic), dynamic onFailure(List< FormValidationError> )?, bool showToastError = true}) → void - Submit the form
-
toString(
) → String -
A string representation of this object.
inherited
-
updateField(
String key, dynamic value) → void - Update a field value in the form
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited