startsWith static method

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

FormFieldValidator that requires the field's value to start with a specific value.

Parameters:

  • prefix The value that the field's value should start with.
  • errorText The error message when the value does not start with the prefix.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<String> startsWith(
  String prefix, {
  String? errorText,
  bool checkNullOrEmpty = true,
}) => StartsWithValidator(
  prefix,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;