LengthValidationController constructor

LengthValidationController({
  1. int minLength = 0,
  2. int? maxLength,
  3. String message = 'Invalid length',
  4. bool required = false,
})

Implementation

LengthValidationController(
    {int minLength = 0,
    int? maxLength,
    String message = 'Invalid length',
    bool required = false})
    : super(
          message: message,
          isValid: ({controller}) {
            String? textValue = controller?.rawValue?.toString();
            if (!required && TextUtils.isEmpty(textValue)) return true;
            return Validators.isLength(textValue!, minLength, maxLength);
          });