CompanionPresenterMixinExtension extension
Provides helper methods of CompanionPresenterMixin.
By extracting helper methods as extension methods, presenter developers
always add their application methods regardless warrying about method
conflict in future which caused by version up of form_companion_presenter
.
Methods
-
buildOnAsyncValidationCompleted(
String name, BuildContext context) → AsyncValidationCompletionCallback - Returns completion logic when any async validation is completed.
-
formStateOf(
BuildContext context) → FormStateAdapter - Gets the ancestor FormState like state from specified BuildContext, and wraps it to FormStateAdapter.
-
getLocale(
BuildContext context) → Locale - Gets current Locale for current BuildContext.
-
handleCanceledAsyncValidationError(
AsyncError error) → void - This method will be called when pending async validation is canceled but the operation throws AsyncError.
-
maybeFormStateOf(
BuildContext context) → FormStateAdapter? - Gets the ancestor FormState like state from specified BuildContext, and wraps it to FormStateAdapter.
-
saveFields(
FormStateAdapter formState) → void - Performs saving of form fields.
-
validateAll(
FormStateAdapter formState) → FutureOr< bool> - Do validation for all fields with their all validators including asynchronous ones, and returns FutureOr to await asynchronous validations.
-
validateAndSave(
FormStateAdapter formState) → Future< bool> - Validates all fields' values and then saves them if there is no validation errors.