validate method
Implementation
@override
List<String>? validate(String? value) {
if (value == null) return null;
final errors = List<String>.empty(growable: true);
if (value.length < minLength)
errors.add(ValidationErrorsLocalized.MIN_LENGTH
.replaceAll("{{0}}", minLength.toString()));
if (value.length > maxLength)
errors.add(ValidationErrorsLocalized.MAX_LENGTH
.replaceAll("{{0}}", maxLength.toString()));
if (errors.isEmpty) return null;
return errors;
}