BloomAsyncValidator<T> typedef
Signature for an asynchronous validator callback on a single value of type T.
Returns a Future completing with an error message string when validation fails,
or null when the value is valid.
Both browser DOM mounting and SSR evaluate async validators seamlessly.
Future<String?> checkUsername(String value) async {
final taken = await api.isUsernameTaken(value);
return taken ? 'Username is already taken.' : null;
}
Implementation
typedef BloomAsyncValidator<T> = Future<String?> Function(T value);