format method
A file format validator.
Implementation
ValidatorFn<XFile> format(Set<String> mimeType, [String? message]) =>
(XFile? value, BuildContext context) {
final fileType = lookupMimeType(value?.path ?? '');
if (value != null && !mimeType.contains(fileType)) {
return message ??
HookFormScope.of(context).invalidFileFormat(mimeType);
}
return this.call(value, context);
};