fn property

void fn=(T? callback())

Sets the variable's value to the result of calling callback.

This callback will be called lazily, if and when the variable's value is actually needed.

If T is non-nullable and callback returns null, the default value for this variable will be used.

Implementation

set fn(T? callback()) {
  if (_frozen) {
    throw StateError(
        "Can't modify a ConfigVariable after pkg.add*Tasks() has been "
        "called.");
  }

  _callback = callback;
  _value = null;
  _cached = false;
}