fileExtension static method
FormFieldValidator that requires the field's value to a valid file extension.
Parameters:
allowedExtensions
The list of allowed file extensions.errorText
The error message when the file extension is invalid.checkNullOrEmpty
Whether to check for null or empty values.
Implementation
static FormFieldValidator<String> fileExtension(
List<String> allowedExtensions, {
String? errorText,
bool checkNullOrEmpty = true,
}) => FileExtensionValidator(
allowedExtensions,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;