isValidString static method

bool isValidString(
  1. String? value, {
  2. int maxLength = 0,
  3. int minLength = 0,
  4. RegExp? pattern,
})

Implementation

static bool isValidString(
  String? value, {
  int maxLength = 0,
  int minLength = 0,
  RegExp? pattern,
}) {
  bool a = value != null &&
      value.isNotEmpty &&
      !equals(value.toLowerCase(), 'null');
  bool b = maxLength <= 0 ? a : a && value.length <= maxLength;
  bool c = b && value.length >= minLength;
  bool d = pattern != null ? pattern.hasMatch(value ?? '') : c;
  return d;
}