MovingTargetAnimation<T> class
Animation that chases a moving target using a Simulate function.
When the target changes, a new simulation is created that picks up from the current value and velocity. Used by Mondrian for layout animations: when the system resizes cards, each card's target rect changes and the spring chases it without resetting.
- Inheritance
-
- Object
- Listenable
- Animation<
T> - FluxAnimation<
T> - MovingTargetAnimation
- Mixed-in types
Constructors
-
MovingTargetAnimation({required TickerProvider vsync, required Animation<
T> target, required Simulate<T> simulate, required T value, required T velocity})
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
- isListening → bool
-
Whether there are any listeners.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
simulate
→ Simulate<
T> -
The simulation generator for moving to target.
final
- status → AnimationStatus
-
The current status of this animation.
no setteroverride
-
target
→ FluxAnimation<
T> -
The moving target.
final
- value → T
-
The current value of the animation.
no setteroverride
- velocity → T
-
The instantaneous change in value, in natural units per second.
no setteroverride
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
-
clearListeners(
) → void -
Removes all listeners added with addListener.
inherited
-
clearStatusListeners(
) → void -
Removes all listeners added with addStatusListener.
inherited
-
didRegisterListener(
) → void -
Calls didStartListening every time a registration of a listener causes
an empty list of listeners to become non-empty.
inherited
-
didStartListening(
) → void -
Called when the number of listeners changes from zero to one.
override
-
didStopListening(
) → void -
Called when the number of listeners changes from one to zero.
override
-
didUnregisterListener(
) → void -
Calls didStopListening when an only remaining listener is unregistered,
thus making the list empty.
inherited
-
drive<
U> (Animatable< U> child) → Animation<U> -
Chains a Tween (or CurveTween) to this Animation.
inherited
-
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
-
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