validateLength method
Implementation
String? validateLength({
required int stringLength,
}) {
if (this == null || this!.isEmpty) {
return "empty_error".translate;
} else if (this!.length < stringLength) {
return "length_error".translate
.replaceAll(
"%a",
stringLength.toString(),
);
} else {
return null;
}
}