putIfAbsent method

T putIfAbsent(
  1. E key,
  2. T value, {
  3. bool doNotifyListeners = true,
})

Performs a Map.putIfAbsent and returns its return value.

Implementation

T putIfAbsent(
  E key,
  T value, {
  bool doNotifyListeners = true,
}) {
  final returnValue = _value.putIfAbsent(key, () => value);
  if (doNotifyListeners) {
    notifyListeners();
  }
  return returnValue;
}