getOrPut method
Implementation
FutureOr<V> getOrPut(K key, FutureOr<V> factory(K id)) {
final existing = this[key];
if (existing != null) return existing;
final newInstance = factory(key) ?? nullPointer<V>("Factory produced null value");
return newInstance.thenOr((resolved) {
// After resolved, add to this map
this.push(key, resolved);
return resolved;
});
}