ensureKey method

void ensureKey(
  1. K key,
  2. V ifAbsent()
)

If key is absent, sets thiskey = ifAbsent().

Implementation

void ensureKey(K key, V Function() ifAbsent) {
  if (!containsKey(key)) this[key] = ifAbsent();
}