duns static method

FormFieldValidator<String> duns({
  1. RegExp? regex,
  2. String? errorText,
  3. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to be a valid DUNS number.

Parameters:

  • regex The regex pattern to match.

  • errorText The error message when the DUNS number is invalid.

  • checkNullOrEmpty Whether to check for null or empty values. This regex matches a valid DUNS number format.

  • It requires exactly 9 digits.

Examples: 123456789, 987654321

Implementation

static FormFieldValidator<String> duns({
  RegExp? regex,
  String? errorText,
  bool checkNullOrEmpty = true,
}) => DunsValidator(
  regex: regex,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;