LengthValidationController constructor
LengthValidationController({})
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);
});