getOr method

V getOr(
  1. K key,
  2. V defaultValue
)

Returns the value for key if it exists and is not null, otherwise returns defaultValue.

Implementation

V getOr(K key, V defaultValue) => this[key] ?? defaultValue;