getLength function

int getLength(
  1. Object value
)

get length.

Implementation

int getLength(Object value) {
  if (value == null) return 0;
  if (value is String) {
    return value.length;
  } else if (value is List) {
    return value.length;
  } else if (value is Map) {
    return value.length;
  } else {
    return 0;
  }
}