ValueAnimation<T> class
A ValueListenable whose value updates each frame over the specified duration to create a continuous visual transition.
A ValueAnimation
can animate to and from null, if T is configured as nullable and
the appropriate lerp callback is provided.
Otherwise, the appropriate transition is configured automatically
via ValueAnimation.lerpCallbackOfExactType.
- Inheritance
-
- Object
- Listenable
- Animation<
T> - ValueAnimation
Constructors
-
ValueAnimation({required TickerProvider vsync, required T initialValue, required Duration duration, Curve curve = Curves.linear, LerpCallback<
T> ? lerp, AnimationBehavior animationBehavior = AnimationBehavior.normal}) - Creates a ValueListenable that smoothly animates between values.
Properties
- animationBehavior → AnimationBehavior
-
The behavior of the controller when AccessibilityFeatures.disableAnimations
is true.
finalinherited
- curve ↔ Curve
-
Determines how quickly the animation speeds up and slows down.
getter/setter pair
- duration ↔ Duration
-
The length of time this animation should last.
getter/setter pair
- 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
-
lerp
→ LerpCallback<
T> -
A function to use for linear interpolation between values.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → AnimationStatus
-
The current status of the value's animation.
no setteroverride
- value ↔ T
-
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.
inherited
-
addStatusListener(
AnimationStatusListener listener) → void -
Calls listener every time the status of the animation changes.
inherited
-
animateTo(
T target, {T? from, Duration? duration, Curve? curve}) → TickerFuture - Triggers an animation, and returns a TickerFuture that completes when it finishes.
-
clearListeners(
) → void -
Removes all listeners added with addListener.
inherited
-
clearStatusListeners(
) → void -
Removes all listeners added with addStatusListener.
inherited
-
didRegisterListener(
) → void -
Called immediately before a status listener is added via addStatusListener.
inherited
-
didUnregisterListener(
) → void -
Called immediately after a status listener is removed via removeStatusListener.
inherited
-
dispose(
) → void -
Release the resources used by this object. The object is no longer usable
after this method is called.
inherited
-
drive<
U> (Animatable< U> child) → Animation<U> -
Chains a Tween (or CurveTween) to this Animation.
inherited
-
jumpTo(
T target) → void - Immediately set a new value.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Calls all the listeners.
inherited
-
notifyStatusListeners(
AnimationStatus status) → void -
Calls all the status listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Stop calling the listener every time the value of the animation changes.
inherited
-
removeStatusListener(
AnimationStatusListener listener) → void -
Stops calling the listener every time the status of the animation changes.
inherited
-
stop(
{bool canceled = true}) → void - Stops the animation.
-
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
Static Methods
-
lerpCallbackOfExactType<
T> () → LerpCallback< T> - Determines the appropriate LerpCallback based on the type argument.