path static method
FormFieldValidator that requires the field's value to be a valid file or folder path.
Parameters:
errorText
The error message when the path is invalid.checkNullOrEmpty
Whether to check for null or empty values.
This regex matches file paths.
- It allows letters, digits, underscores, hyphens, and forward slashes.
Examples: /path/to/file, C:/Users/Name/Documents
Implementation
static FormFieldValidator<String> path({
String? errorText,
bool checkNullOrEmpty = true,
}) => PathValidator(
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;