asyncValidator abstract method

Future<E?> asyncValidator(
  1. T value
)

An asynchronous validator that should be overridden to provide custom validation logic.

Returns a Future that completes with an exception of type E if validation fails, or null if validation succeeds.

Example

@override
Future<MyException?> asyncValidator(String value) async {
  // Perform asynchronous validation logic
  final isValid = await someAsyncCheck(value);
  return isValid ? null : MyException('Validation failed');
}

Implementation

Future<E?> asyncValidator(T value);