fileExtension static method
FormFieldValidator that requires the field's value to a valid file extension.
Parameters:
allowedExtensionsThe list of allowed file extensions.errorTextThe error message when the file extension is invalid.checkNullOrEmptyWhether 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;