call method

  1. @override
T call()
override

Lazily evaluates the function passed into the constructor.

Implementation

@override
T call() {
  T? result = _cache[this] as T?;
  if (result != null) return result;
  result = _func();
  _cache[this] = result;
  return result;
}