putIfAbsent<T> method

void putIfAbsent<T>(
  1. String name, {
  2. T? value,
})

Puts a value only if it hasn't ben added before.

Implementation

void putIfAbsent<T>(String name, {T? value}) {
  _map.putIfAbsent(name, () => value);
}