minLength method

FormFieldValidator minLength (num minLength, { String errorText })

FormFieldValidator that requires the length of the field's value to be greater than or equal to the provided minimum length.

Implementation

static FormFieldValidator minLength(
  num minLength, {
  String errorText,
}) {
  return (valueCandidate) {
    if (valueCandidate != null && valueCandidate.length < minLength) {
      return errorText ??
          "Value must have a length greater than or equal to $minLength";
    }
    return null;
  };
}