ScopedAnimationController class abstract interface

An interface representing an animation controller scoped strictly to a presentation widget lifecycle, exposing the Flutter-compatible view and drive.

In blooming_flutter, DurableAnimationController does not expose view at its root to eliminate zombie listener leaks outside presentation trees. ScopedAnimationController is provided strictly within mounted widget builders (such as composed.animate(...)), guaranteeing that all registered listeners are automatically purged upon element unmount.

System Architectural Flow

[composed.animate(controller, builder)]
                │
                ▼ (Mounts & Couples)
[ScopedAnimationController (ctrl)] ──> [ctrl.view / ctrl.drive] ──> [Leaf Animation Widgets]
                │
                ▼ (Unmounts / Deactivates)
[Proxy Disposed] ──> [Listeners Purged] (Zero zombie listener leaks)

Warning (Anti-Pattern Prevention):

BAD:

// [Anti-Pattern] Escaping scoped view to outer class field
class _MyPageState extends State<MyPage> {
  Animation<double>? leakedView;

  @override
  Widget build(BuildContext context) {
    return composed.animate(controller, (context, via, ctrl) {
      leakedView = ctrl.view; // Danger: leaked reference to unmounted view!
      return FadeTransition(opacity: ctrl.view, child: const SizedBox());
    });
  }
}

GOOD:

// [Recommended] Confine scoped view access strictly to the builder closure
Widget build(BuildContext context) {
  return composed.animate(controller, (context, via, ctrl) {
    return FadeTransition(opacity: ctrl.view, child: const SizedBox());
  });
}
Implemented types
Available extensions

Properties

animationBehavior → AnimationBehavior
The behavior of the controller when accessibility settings disable animations.
no setterinherited
debugLabel → String?
A label that is used in the toString output. Intended to aid with identifying animation controller instances in debug output.
no setterinherited
duration ↔ Duration?
The length of time this animation should last.
getter/setter pairinherited
hashCode → int
The hash code for this object.
no setterinherited
isActive → bool
Whether the underlying animation controller engine is currently active.
no setterinherited
isAnimating → bool
Whether this animation is currently animating.
no setterinherited
isCompleted → bool
Whether this animation is stopped at the end (status is AnimationStatus.completed).
no setterinherited
isDismissed → bool
Whether this animation is stopped at the beginning (status is AnimationStatus.dismissed).
no setterinherited
isDormant → bool
Whether this controller is currently in a dormant state (hibernated / inactive without an active TickerProvider).
no setterinherited
isForwardOrCompleted → bool
Whether the current aim of the animation is toward completion.
no setterinherited
lastElapsedDuration → Duration?
The amount of time that has elapsed since the animation started.
no setterinherited
lowerBound → double
The value at which this animation is deemed to be dismissed.
no setterinherited
policy → DurabilityPolicy
The durability policy governing timeline preservation across dormant deactivations.
no setterinherited
reverseDuration ↔ Duration?
The length of time this animation should last when going in reverse.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → AnimationStatus
The current status of this animation.
no setterinherited
upperBound → double
The value at which this animation is deemed to be completed.
no setterinherited
value ↔ double
The current value of the animation.
getter/setter pairinherited
velocity → double
The rate of change of value per second.
no setterinherited
view → Animation<double>
Returns an Animation<double> view coupled strictly to this mounted widget.
no setter
view → Animation<double>

Available on DurableAnimationController, provided by the DurableAnimationTestingExtension extension

Returns the underlying raw view strictly for unit testing harnesses.
no setter

Methods

animateBack(double target, {Duration? duration, Curve curve = Curves.linear}) → TickerFuture
Drives the animation from its current value to the given target, "backward".
inherited
animateBackWith(Simulation simulation) → TickerFuture
Drives the animation according to the given simulation with a status of reverse.
inherited
animateTo(double target, {Duration? duration, Curve curve = Curves.linear}) → TickerFuture
Drives the animation from its current value to the given target, "forward".
inherited
animateWith(Simulation simulation) → TickerFuture
Drives the animation according to the given simulation.
inherited
attachVsync(TickerProvider vsync) → void

Available on DurableAnimationController, provided by the DurableAnimationTestingExtension extension

Attaches a TickerProvider as an active vsync holder.
detachVsync(TickerProvider vsync) → bool

Available on DurableAnimationController, provided by the DurableAnimationTestingExtension extension

Detaches a TickerProvider from the active vsync holder pool.
drive<U>(Animatable<U> child) → Animation<U>
Passes the view of this animation through an Animatable to create a transformed Animation.
drive<U>(Animatable<U> child) → Animation<U>

Available on DurableAnimationController, provided by the DurableAnimationTestingExtension extension

Drives an animatable using the raw view strictly for unit testing harnesses.
fling({double velocity = 1.0, SpringDescription? springDescription, AnimationBehavior? animationBehavior}) → TickerFuture
Drives the animation with a spring and initial velocity.
inherited
forward({double? from}) → TickerFuture
Starts running this animation forwards (towards the end).
inherited
hibernate() → void

Available on DurableAnimationController, provided by the DurableAnimationTestingExtension extension

Hibernates the controller, stopping the active ticker and clearing vsync holders.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe({bool distinct = true, bool equals(double previous, double next)?, Graceful? graceful}) → Bloom<double>

Available on DurableAnimationController, provided by the DurableAnimationControllerObserveExtension extension

Observes this controller's animated value as a reactive Bloom<double>.
observeStatus({bool distinct = true, Graceful? graceful}) → Bloom<AnimationStatus>

Available on DurableAnimationController, provided by the DurableAnimationControllerObserveExtension extension

Observes this controller's animation status as a reactive Bloom of AnimationStatus.
repeat({double? min, double? max, bool reverse = false, Duration? period, int? count}) → TickerFuture
Starts running this animation in the forward direction, and restarts when complete.
inherited
reset() → void
Sets the controller's value to lowerBound, stopping the animation.
inherited
reverse({double? from}) → TickerFuture
Starts running this animation in reverse (towards the beginning).
inherited
stop({bool canceled = true}) → void
Stops running this animation.
inherited
toggle({double? from}) → TickerFuture
Toggles the direction of this animation.
inherited
toString() → String
A string representation of this object.
inherited
toStringDetails() → String
Returns detailed diagnostic string representation for debug output.
inherited
wake(TickerProvider vsync) → void

Available on DurableAnimationController, provided by the DurableAnimationTestingExtension extension

Wakes this controller by attaching vsync.

Operators

operator ==(Object other) → bool
The equality operator.
inherited