lengthLt static method

String? lengthLt(
  1. String? checkValue,
  2. int lt, {
  3. String? errorMessage,
})

Checks that the length of checkValue is less then lt

If checkValue is not null and checkValue.length is not less than lt than errorMessage is returned if provided, else the default error is provided. Otherwise null is returned

Implementation

static String? lengthLt(String? checkValue, int lt, {String? errorMessage}) {
  if (checkValue != null && !(checkValue.length < lt)) {
    return errorMessage ?? "Field length not less than $lt";
  }
  return null;
}