TweenAnimation<T> class
Tween animation for interpolating values.
Fields are non-final so instances can be reconfigured after being acquired from an ObjectPool, avoiding per-tween allocation overhead.
- Inheritance
- Implementers
Constructors
- TweenAnimation({required T start, required T end, required T lerp(T start, T end, double t), required void onUpdate(T value), required double duration, Easing easing = Easings.linear, bool loop = false, VoidCallback? onComplete})
- Create a tween animation
Properties
- currentTime ↔ double
-
Current time in the animation
getter/setter pairinherited
- duration ↔ double
-
Animation duration (non-final to allow pool reconfiguration).
getter/setter pairinherited
- easing ↔ Easing
-
Easing function
getter/setter pair
- end ↔ T
-
End value
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isComplete → bool
-
Check if animation is complete
no setterinherited
- isPaused ↔ bool
-
Whether animation is paused
getter/setter pairinherited
- lerp ↔ T Function(T start, T end, double t)
-
Interpolation function
getter/setter pair
- loop ↔ bool
-
Whether animation loops (non-final to allow pool reconfiguration).
getter/setter pairinherited
- normalizedTime → double
-
Get normalized time (0.0 to 1.0)
no setterinherited
- onComplete ↔ VoidCallback?
-
Callback when animation completes
getter/setter pairinherited
- onUpdate ↔ void Function(T value)
-
Callback with current value
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speed ↔ double
-
Animation speed multiplier
getter/setter pairinherited
- start ↔ T
-
Start value
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → void -
Pause the animation
inherited
-
play(
) → void -
Play the animation
inherited
-
reset(
) → void -
Reset all mutable state so the animation can be replayed or reused
from an ObjectPool.
inherited
-
stop(
) → void -
Stop and reset
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
double deltaTime) → void -
Update the animation
inherited
-
updateAnimation(
double deltaTime) → void -
Override this to implement animation logic
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited