isEmptyString function

bool isEmptyString(
  1. String? s, {
  2. bool trim = false,
})

Returns true if s is empty or null.

trim if true will trim s before check for String.isEmpty.

Implementation

bool isEmptyString(String? s, {bool trim = false}) {
  if (s == null) return true;
  if (trim) {
    s = s.trim();
  }
  return s.isEmpty;
}