getAsList<T> method

List<T> getAsList<T>(
  1. String key, [
  2. List<T>? orElse
])

Get the list corresponding to key in the map.

If key is not found, the list of orElse is returned.

Implementation

List<T> getAsList<T>(String key, [List<T>? orElse]) {
  if (!arg.containsKey(key)) {
    return orElse ?? [];
  }
  return (arg[key] as List?)?.cast<T>() ?? orElse ?? [];
}