isValidString static method

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

Implementation

static bool isValidString(
  String? value, {
  int maxLength = 0,
  int minLength = 0,
  RegExp? regs,
}) {
  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 = regs != null ? regs.hasMatch(value ?? '') : c;
  return d;
}