validate method
Validates the control
.
Implementation
@override
Map<String, dynamic>? validate(AbstractControl<dynamic> control) {
if (control.value == null) {
return <String, dynamic>{ValidationMessage.any: true};
}
assert(control.value is Iterable<T>,
'''Expected the control value to be of type ${(Iterable<T>).runtimeType}
but found type ${control.value.runtimeType.toString()}.''');
final iterable = control.value as Iterable<T>;
return iterable.any(test)
? null
: <String, dynamic>{ValidationMessage.any: true};
}