get<T> method

T get<T>(
  1. K key,
  2. T orElse
)

Get the value corresponding to key in the map.

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

Implementation

T get<T>(K key, T orElse) {
  assert(key != null, "The key is empty.");
  if (!containsKey(key)) {
    return orElse;
  }
  return (this[key] ?? orElse) as T;
}