lengthGtEq static method

String? lengthGtEq(
  1. String? checkValue,
  2. int gtEq, {
  3. String? errorMessage,
})

Checks that the length of checkValue is greater then or equal to gtEq

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

Implementation

static String? lengthGtEq(String? checkValue, int gtEq,
    {String? errorMessage}) {
  if (checkValue != null && !(checkValue.length >= gtEq)) {
    return errorMessage ?? "Field length not greater than or equal too $gtEq";
  }
  return null;
}