withLifecycle method
Attaches this StreamSubscription to a RaiiLifecycleAware object.
The subscription will be automatically cancelled when the lifecycle is disposed.
Returns the original StreamSubscription for chaining.
Implementation
StreamSubscription<T> withLifecycle(
RaiiLifecycleAware lifecycleAware, {
String? debugLabel,
}) {
_StreamSubscriptionRaiiLifecycle.withLifecycle(
lifecycleAware,
sub: this,
debugLabel: debugLabel,
);
return this;
}