getOrCompute<T> method
T
getOrCompute<T>(
- K key,
- T computation()
Implementation
T getOrCompute<T>(K key, T Function() computation) {
final thiz = this;
if (thiz == null) return computation();
final value = thiz[key];
return value is T ? value : computation();
}