isNullOrEmpty static method

bool isNullOrEmpty(
  1. String? value, {
  2. bool considerWhiteSpaceAsEmpty = false,
})

Implementation

static bool isNullOrEmpty(String? value,
    {bool considerWhiteSpaceAsEmpty = false}) {
  if (considerWhiteSpaceAsEmpty) {
    return value == null || _emptyRegex.hasMatch(value);
  }
  return value?.isEmpty ?? true;
}