CueTimelineImpl class

Manages and coordinates multiple animation tracks.

A timeline combines multiple CueTracks with different timings into a single coordinated animation. The timeline:

  • Maintains a default track and allows additional tracks via TrackConfig
  • Synchronizes all tracks to a single progress value (0-1)
  • Calculates overall forward/reverse durations as the max of all tracks
  • Handles track lifecycle (creation, caching, release)
  • Maintains overall animation status and supports repeating animations

Typical usage:

final timeline = CueTimelineImpl.fromMotion(Spring.smooth());
final (track1, token1) = timeline.obtainDefaultTrack();
final (track2, token2) = timeline.obtainTrack(
  TrackConfig(motion: differentMotion, reverseMotion: differentMotion)
);
timeline.prepare(forward: true);
// animate...
timeline.release(token1);
timeline.release(token2);
Inheritance
Mixed-in types

Constructors

CueTimelineImpl(TrackConfig defaultConfig, {double initialProgress = 0.0})
Creates a timeline implementation
CueTimelineImpl.fromConfig(TrackConfig config, {double initialProgress = 0.0})
Creates a timeline from a single track configuration. The track is created immediately and available as the default track.
factory
CueTimelineImpl.fromMotion(CueMotion motion, {CueMotion? reverseMotion})
Creates a timeline from a single motion (forward and reverse use the same).
factory

Properties

defaultConfig → TrackConfig
Default track configuration used when timeline is created. Always present and cannot be removed from the timeline.
final
forwardDuration → double
Maximum forward duration across all tracks (in seconds). Cached until tracks are added/removed.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether this timeline has any listeners.
no setter
progress → double
Overall timeline progress (0-1).
no setteroverride
reverseDuration → double
Maximum reverse duration across all tracks (in seconds). Cached until tracks are added/removed.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → AnimationStatus
Current animation status. Represents the overall status across all tracks (forward, reverse, completed, dismissed).
no setteroverride
tolerance ↔ Tolerance
How close to the actual end of the simulation a value at a particular time must be before isDone considers the simulation to be "done".
getter/setter pairinherited
tracks → Map<TrackConfig, TrackEntry>
All active tracks mapped by their configuration. Includes the default track and any obtained via obtainTrack.
no setteroverride

Methods

addEventListener<E extends T>(void listener(E)) → EventDisposer
Add an event listener that will be called with the event data when fireEvent is called.
inherited
addStatusListener(AnimationStatusListener listener) → void
Calls listener every time the status of the animation changes.
inherited
buildTrack(TrackConfig config) → CueTrack
Builds a track instance for a configuration.
override
clearStatusListeners() → void
Removes all listeners added with addStatusListener.
inherited
didRegisterListener() → void
Called immediately before a status listener is added via addStatusListener.
override
didUnregisterListener() → void
Called immediately after a status listener is removed via removeStatusListener.
override
dispose() → void
Disposes timeline resources.
override
dx(double time) → double
The velocity of the object in the simulation at the given time.
override
fireEvent(TimelineEvent data) → void
Fire an event with data to all event listeners
inherited
isDone(double time) → bool
Whether the simulation is "done" at the given time.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyStatusListeners(AnimationStatus status) → void
Calls all the status listeners.
inherited
obtainDefaultTrack() → (CueTrack, ReleaseToken)
Gets or creates the default track.
inherited
obtainTrack(TrackConfig config) → (CueTrack, ReleaseToken)
Gets or creates a track for the given configuration.
override
prepare({required bool forward, double? from, double? target, double? velocity}) → void
Prepares timeline for animation playback.
override
prepareForRepeat(RepeatConfig config) → void
Prepares timeline for repeating animations.
override
release(ReleaseToken token) → void
Releases a track obtained via obtainTrack or obtainDefaultTrack.
override
removeStatusListener(AnimationStatusListener listener) → void
Stops calling the listener every time the status of the animation changes.
inherited
reset() → void
Resets timeline to initial state (progress 0, status dismissed). Clears repeat configuration and updates all tracks to progress 0.
override
setProgress(double value, {bool forward = true, bool forceLinear = false}) → void
Sets timeline progress directly (0-1).
override
toString() → String
A string representation of this object.
inherited
willAnimate({required bool forward}) → void
Fires pre-animation event.
override
x(double time) → double
The position of the object in the simulation at the given time.
override

Operators

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