withLifecycle method
Attaches this ticker to a RaiiLifecycleAware object for automatic cleanup.
The ticker will be stopped and disposed when the lifecycle is disposed.
Implementation
Ticker withLifecycle(
RaiiLifecycleAware lifecycleAware, {
String? debugLabel,
}) {
RaiiDisposeable.withLifecycle(
lifecycleAware,
dispose: () {
stop();
dispose();
},
debugLabel: debugLabel,
);
return this;
}