lengthGt static method

String? lengthGt(
  1. String? checkValue,
  2. int gt, {
  3. String? errorMessage,
})

Checks that the length of checkValue is greater than then gt

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

Implementation

static String? lengthGt(String? checkValue, int gt, {String? errorMessage}) {
  if (checkValue != null && !(checkValue.length > gt)) {
    return errorMessage ?? "Field length not greater than $gt";
  }
  return null;
}