Tween class

Constructors

Tween(JSTween jsTween)

Properties

delay num
Gets the animation's initial delay which is the length of time in seconds before the animation should begin.
getter/setter pair
duration num
Gets the animation's duration, not including any repeats or repeatDelays.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
iteration num
Gets the iteration (the current repeat) of tweens.
getter/setter pair
jsTween → JSTween
final
paused bool
Gets the animation's paused state which indicates whether or not the animation is currently paused.
getter/setter pair
repeat num
Gets the number of times that the tween should repeat after its first iteration.
getter/setter pair
repeatDelay num
Gets the amount of time in seconds between repeats.
getter/setter pair
reversed bool
Gets the animation's reversed state which indicates whether or not the animation should be played backwards.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startTime num
Gets the time at which the animation begins on its parent timeline (after any delay that was defined).
getter/setter pair
timeScale num
get Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc.
getter/setter pair
totalDuration num
Gets or sets the total duration of the tween in seconds including any repeats or repeatDelays.
getter/setter pair
yoyo bool
Gets the timeline's yoyo state, where true causes the timeline to go back and forth, alternating backward and forward on each repeat.
getter/setter pair

Methods

endTime({bool includeRepeats = true}) num
Returns the time at which the animation will finish according to the parent timeline's local time.
eventCallback(String type, Function callback, List? params) Tween
Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" along with any parameters that should be passed to that callback.
globalTime(num localTime) num
Converts a local time to the corresponding time on the gsap.globalTimeline (factoring in all nesting, timeScales, etc.).
invalidate() Tween
Flushes any internally-recorded starting/ending values which can be useful if you want to restart an animation without reverting to any previously recorded starting values.
isActive() bool
Indicates whether or not the animation is currently active (meaning the virtual playhead is actively moving across this instance's time span and it is not paused, nor are any of its ancestor timelines).
kill({Object? obj, String propertiesList = "all"}) Tween
Kills the animation entirely or in part depending on the parameters. To kill means to immediately stop the animation, remove it from its parent timeline, and release it for garbage collection.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause({int? atTime, bool suppressEvents = true}) Tween
Pauses the instance, optionally jumping to a specific time.
play({num? from, bool suppressEvents = true}) Tween
Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is).
progress(num? value, {bool suppressEvents = true}) Tween
Gets or sets the tween's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is halfway complete, and 1 is complete.
restart({bool includeDelay = false, bool suppressEvents = true}) Tween
Restarts and begins playing forward from the beginning.
resume() Tween
Resumes playing without altering direction (forward or reversed).
reverse([dynamic from, bool suppressEvents = true]) Tween
Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease.
revert() Tween
Reverts the animation and kills it, returning the targets to their pre-animation state including the removal of inline styles added by the animation.
seek(dynamic time, {bool suppressEvents = true}) Tween
Jumps to a specific time without affecting whether or not the instance is paused or reversed.
targets() List
An array of target objects whose properties the Tween animates. If selector text was used when creating the tween, this array will contain the DOM elements that matched that query string.
then(Function callback) Function
Returns a Function so that you can uses function to track when a tween or timeline is complete.
time(int? value, {bool suppressEvents = true}) Tween
Gets or sets the local position of the playhead (essentially the current time), not including any repeats or repeatDelays.
toString() String
A string representation of this object.
inherited
totalProgress(num value, {bool suppressEvents = true}) num
Gets or sets the tween's totalProgress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is halfway complete, and 1 is complete.
totalTime(num time, {bool suppressEvents = true}) num
Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays.

Operators

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