startsWith method

Validator startsWith(
  1. String prefix, {
  2. String? errorMessage,
})

Adds a StartsWithRule to the validator.

prefix is the string that the field value should start with. errorMessage is an optional custom error message.

Implementation

Validator startsWith(String prefix, {String? errorMessage}) {
  addRule(StartsWithRule(prefix, errorMessage: errorMessage));
  return this;
}