Lazy<T> constructor
Lazy<T> (})
_initialize
is used to initialize the value.
reinitialize
controls if a value is reused or initialized again.
If reinitialize
returns true, _initialize
is called again to recreate
the value.
Implementation
Lazy(
this._initialize, {
FutureOr<bool> Function(T value)? reinitializeOnValue,
this.reinitializeOnError = false,
}) : _reinitialize = reinitializeOnValue ?? ((_) => false);