AnimationControllerRaiiExt extension

Extension for managing AnimationController lifecycle.

Example:

class MyWidgetState extends State<MyWidget>
    with TickerProviderStateMixin, RaiiStateMixin {
  late final animationController = AnimationController(vsync: this)
    .withLifecycle(this, debugLabel: 'MyAnimationController');
}
on

Methods

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

Available on AnimationController, provided by the AnimationControllerRaiiExt extension

Attaches this controller to a RaiiLifecycleAware object for automatic disposal.