withLifecycle method

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

Attaches this change notifier to a RaiiLifecycleAware object for automatic disposal.

The change notifier will be disposed when the lifecycle is disposed.

Implementation

T withLifecycle(RaiiLifecycleAware lifecycleAware, {String? debugLabel}) {
  RaiiDisposeable.withLifecycle(
    lifecycleAware,
    dispose: dispose,
    debugLabel: debugLabel,
  );
  return this;
}