EasyValidator.minLength constructor

const EasyValidator.minLength(
  1. int minLength, [
  2. String? errorMessage
])

A factory constructor for creating a MinLengthValidator.

The errorMessage is the error message to be displayed when the validation fails. The minLength is the minimum length required for the validation to pass. Example usage:

final validator = EasyValidator.minLength(8,'Value must have at least 8 characters');
String? result = validator.validate("test");
print(result); // 'Value must have at least 8 characters'

Implementation

const factory EasyValidator.minLength(int minLength, [String? errorMessage]) =
    MinLengthValidator;