passes method
Validates the value using the given context.
Returns true if valid, otherwise false.
Implementation
@override
FutureOr<bool> passes(ValidationContext context) {
final value = context.value;
if (value == null) return false;
final acceptedValues = ['yes', 'on', '1', 1, true, 'true'];
if (value is String) {
return acceptedValues.contains(value.toLowerCase());
}
return acceptedValues.contains(value);
}