withLifecycle method

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

Attaches this controller to a RaiiLifecycleAware object for automatic disposal.

The controller will be disposed when the lifecycle is disposed.

Implementation

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

  return this;
}