portNumber static method

FormFieldValidator<String> portNumber({
  1. int min = 0,
  2. int max = 65535,
  3. String? errorText,
  4. bool checkNullOrEmpty = true,
})

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

Parameters:

  • min The minimum port number (default: 0).
  • max The maximum port number (default: 65535).
  • errorText The error message when the port number is invalid.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<String> portNumber({
  int min = 0,
  int max = 65535,
  String? errorText,
  bool checkNullOrEmpty = true,
}) => PortNumberValidator(
  min: min,
  max: max,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;