AsyncValidator<T> typedef
AsyncValidator<T> =
FutureOr<String?> Function(T? value, AsyncValidatorOptions options)
A function represents async validation invocation.
It takes target value
, which may be null
,
and then returns validation error message if the value is not valid,
or returns null
if the value is valid.
options
is AsyncValidatorOptions which has options for validators
such as Locale to localize error message.
Implementation
typedef AsyncValidator<T> = FutureOr<String?> Function(
T? value,
AsyncValidatorOptions options,
);