getList method

List getList(
  1. String key
)

Reads a key value of List type from Map.

If value is NULL or not List type return empty ListdefaultList

Implementation

// ignore: always_specify_types
List getList(String key) {
  if (containsKey(key)) {
    if (this[key] is List) {
      return this[key] ?? defaultList;
    }
  }
  errorLogsNS("Map.getString[$key] has incorrect data :  ${this[key]}");
  return defaultList;
}