call method
Implementation
@override
Object? call(XFile value) {
final name = value.name.toLowerCase();
if (whereExtensionIn != null &&
!whereExtensionIn!.map((e) => e.toLowerCase()).any(name.endsWith)) {
return FileValidationError(
validation: this,
code: errorCode,
whereExtensionIn: whereExtensionIn,
whereExtensionNotIn: whereExtensionNotIn,
);
} else if (whereExtensionNotIn != null &&
whereExtensionNotIn!.map((e) => e.toLowerCase()).any(name.endsWith)) {
return FileValidationError(
validation: this,
code: errorCode,
whereExtensionIn: whereExtensionIn,
whereExtensionNotIn: whereExtensionNotIn,
);
}
return null;
}