isEmpty function

bool isEmpty(
  1. Object object
)

Returns true String or List or Map is empty.

Implementation

bool isEmpty(Object object) {
  if (object == null) return true;
  if (object is String && object.isEmpty) {
    return true;
  } else if (object is List && object.isEmpty) {
    return true;
  } else if (object is Map && object.isEmpty) {
    return true;
  }
  return false;
}