putIfAbsentAsync method
Implementation
FutureOr<T> putIfAbsentAsync(Object? o, FutureOr<T> Function() ifAbsent) {
if (o == null) {
return ifAbsent();
}
var prev = this[o];
if (prev != null) return prev;
var ret = ifAbsent();
if (ret is Future<T>) {
return this[o] = ret.then((r) {
this[o] = r;
return r;
});
} else {
this[o] = ret;
return ret;
}
}