getOrInit method

  1. @override
T getOrInit(
  1. T func()
)
override

Gets the contents of the cell, initializing it with func if the cell was empty.

Implementation

@override
T getOrInit(T Function() func) {
  if (_val != null) {
    return _val!;
  }
  _val = func();
  return _val!;
}