withInitialValue method

AtomInitialValue<T> withInitialValue(
  1. T value, {
  2. bool keepAlive = true,
})

Create an initial value override, which can be given to an AtomScope or AtomRegistry.

By default it calls Atom.keepAlive, to ensure the initial value is not disposed.

Implementation

AtomInitialValue<T> withInitialValue(
  T value, {
  bool keepAlive = true,
}) {
  if (keepAlive) {
    _keepAlive = true;
  }
  return AtomInitialValue(this, value);
}