getOrDefault method

V? getOrDefault(
  1. K key,
  2. V? defaultValue
)

Returns the value associated with the given key, or defaultValue if the key does not exist.

Implementation

V? getOrDefault(K key, V? defaultValue) =>
    containsKey(key) ? this[key]! : defaultValue;