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 is bool) return true;
if (value is num) return value == 0 || value == 1;
if (value is String) {
final lower = value.toLowerCase();
return ['true', 'false', '1', '0'].contains(lower);
}
return false;
}