isEmpty static method

bool isEmpty(
  1. Object? obj
)

判空

Implementation

static bool isEmpty(Object? obj) {
  if (obj is String) {
    return obj.isEmpty;
  }
  if (obj is Iterable) {
    return obj.isEmpty;
  }
  if (obj is Map) {
    return obj.isEmpty;
  }
  return obj == null;
}