isEmpty function

bool isEmpty(
  1. dynamic value
)

do what @author yulun @since 2020-08-15 23:01

Implementation

bool isEmpty(dynamic value) {
  if (value == null) {
    return true;
  }
  if (value is String) {
    return value.isEmpty;
  }
  if (value is Iterable<dynamic>) {
    return value.isEmpty;
  }
  if (value is Map) {
    return value.isEmpty;
  }
  assert(false, 'unSupport value type: $value');
  return true;
}