validateAsync method
- dynamic value, {
- bool exists = true,
Always returns a Future, allowing async + sync validators to compose.
Implementation
Future<Result> validateAsync(dynamic value, {bool exists = true}) async {
if ((value == null && isNullable && exists) || (!exists && isOptional)) {
return Result.valid(value);
}
return await validator(value);
}