CompanionPresenterFeatures<A extends FormStateAdapter> class
abstract
Defines overridable CompanionPresenterMixin subtype specific features.
CompanionPresenterMixin users, mainly sub-mixin-type implementation, can call methods in this class via CompanionPresenterMixinExtension's extension methods instead of calling methods of this class directly.
form_companion_presenter
uses template method pattern to allow developers
extend features of CompanionPresenterMixin, but in dart, this is hard to
avoid method conflict between methods which were added by such subtypes's
developers or application developers who mix-ins the mixin type, because
dart does not provide method overloading and method hiding either.
So, form_companion_presenter
separates template methods for sub-mixin-type
developers to allow override the methods to change default behavior and
providing implementation of abstract methods like maybeFormStateOf.
Constructors
- CompanionPresenterFeatures()
-
Initializes a new CompanionPresenterFeatures instance.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildOnAsyncValidationCompleted(
String name, BuildContext context) → AsyncValidationCompletionCallback - Returns completion logic when any async validation is completed.
-
getAsyncValidationFailureMessage(
AsyncError error, Locale locale) → String - Returns a validation error message which is shown when the async validator failed to complete with an exception or an error.
-
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.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restoreField(
BuildContext context, String name, Object? value, {required bool hasError}) → void -
Do validation the FormField for specified
name
. -
saveFields(
A formState) → void - Performs saving of form fields.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited