path static method

FormFieldValidator<String> path({
  1. String? errorText,
  2. bool checkNullOrEmpty = true,
})

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;