withLifecycle method

ValueNotifier<T> withLifecycle(
  1. RaiiLifecycleAware lifecycleAware, {
  2. String? debugLabel,
})

Attaches this notifier to a RaiiLifecycleAware object for automatic disposal.

The notifier will be disposed when the lifecycle is disposed.

Implementation

ValueNotifier<T> withLifecycle(
  RaiiLifecycleAware lifecycleAware, {
  String? debugLabel,
}) {
  RaiiDisposeable.withLifecycle(
    lifecycleAware,
    dispose: dispose,
    debugLabel: debugLabel,
  );

  return this;
}