ControlledAnimation class

A controlled animation that wraps an AnimationController and provides smooth transitions between values using curves.

This class extends Animation<double> and allows programmatic control of animations with custom start and end values, as well as curve adjustments.

Overview

Use ControlledAnimation when you need fine-grained control over animation values and want to smoothly transition from any current value to a target value with a specified curve.

Example

final controller = AnimationController(
  vsync: this,
  duration: const Duration(milliseconds: 300),
);
final animation = ControlledAnimation(controller);

// Animate to 0.8 with ease-in curve
animation.forward(0.8, Curves.easeIn);
Inheritance

Constructors

ControlledAnimation(AnimationController _controller)
Creates a ControlledAnimation that wraps the given AnimationController.

Properties

hashCode int
The hash code for this object.
no setterinherited
isAnimating bool
Whether this animation is running in either direction.
no setterinherited
isCompleted bool
Whether this animation is stopped at the end.
no setterinherited
isDismissed bool
Whether this animation is stopped at the beginning.
no setterinherited
isForwardOrCompleted bool
Whether the current aim of the animation is toward completion.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status AnimationStatus
The current status of this animation.
no setteroverride
value double
The current value of the animation.
getter/setter pairoverride-getter

Methods

addListener(VoidCallback listener) → void
Calls the listener every time the value of the animation changes.
override
addStatusListener(AnimationStatusListener listener) → void
Calls listener every time the status of the animation changes.
override
drive<U>(Animatable<U> child) Animation<U>
Chains a Tween (or CurveTween) to this Animation.
inherited
forward(double to, [Curve? curve]) TickerFuture
Animates from the current value to the specified target value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(VoidCallback listener) → void
Stop calling the listener every time the value of the animation changes.
override
removeStatusListener(AnimationStatusListener listener) → void
Stops calling the listener every time the status of the animation changes.
override
toString() String
A string representation of this object.
inherited
toStringDetails() String
Provides a string describing the status of this object, but not including information about the object itself.
inherited

Operators

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