PhaseTrackController<P extends Object> class
A TrackController extension that understands phases.
Wraps the standard sync-barrier playback with phase-level navigation:
- playPhases plays all phases in order (auto-advancing via sync barriers and TrackStep.loop for looping timelines).
- goToPhase jumps to a specific phase by replaying only that phase's animations.
- currentPhase reports the phase currently being played or settled.
Phase changes are reported through a PhaseTransition callback: PhaseTransitioning when a new phase begins animating, and PhaseSettled when playback for the active phase comes to rest.
With LoopMode.pingPong, phases are visited in reverse order after the forward pass. Each phase's own steps still play forward.
- Inheritance
-
- Object
- Listenable
- Animation<
TrackValueReader> - TrackController
- PhaseTrackController
- Available extensions
Constructors
-
PhaseTrackController({required TickerProvider vsync, List<
TrackValue< ? initialValues, VelocityTracking velocityTracking = const VelocityTracking.on(), String? debugLabel})Object> > - Creates a phase track controller.
Properties
-
activeTimeline
→ TrackPhaseTimeline<
P> ? -
The active phase timeline, if any.
no setter
- currentPhase → P?
-
The current phase during playback.
no setter
- debugCreator → Object?
-
Available on TrackController, provided by the TrackControllerInspection extension
What created this controller, when Motor's builder widgets created it: the builder'sElement.no setter - debugLabel → String?
-
A human-readable name shown by optional inspection tools.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- inspectable ↔ bool
-
Available on TrackController, provided by the TrackControllerInspection extension
Whether inspection tools show this controller.getter/setter pair - inspectionGroup ↔ String?
-
Available on TrackController, provided by the TrackControllerInspection extension
The group inspection tools show this controller in, if any.getter/setter pair - isAnimating → bool
-
Whether any track is currently animating.
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
- isMuted → bool
-
Available on TrackController, provided by the TrackControllerInspection extension
Whether the controller's ticker is muted, such as by aTickerMode(enabled: false)above the widget that provides its vsync.no setter - lastElapsedDuration → Duration?
-
The elapsed duration of the current run, or null when not animating.
no setterinherited
-
motionOverride
↔ Motion? Function(Track<
Object> track)? -
Available on TrackController, provided by the TrackControllerInspection extension
Chooses motions that replace the authored ones in future playback.getter/setter pair - playbackSpeed ↔ double
-
Available on TrackController, provided by the TrackControllerInspection extension
The controller-local playback rate used by inspection tooling.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → AnimationStatus
-
The status of the tracks moved since this controller was last idle.
no setterinherited
- value → TrackValueReader
-
Returns a reader for the current track values.
latefinalinherited
- velocityTracking ↔ VelocityTracking
-
Controls whether set automatically tracks velocity from position
samples.
getter/setter pairinherited
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
-
animate(
List< TrackAnimation< animations, {void onStep(Track<Object> >Object> track, int stepIndex)?}) → MotionFuture -
Animates a list of track
animations.inherited -
animationOf<
T extends Object> (Track< T> track) → Animation<T> -
An Animation of
track's value on this controller.inherited -
clearListeners(
) → void -
Removes all listeners added with addListener.
inherited
-
clearStatusListeners(
) → void -
Removes all listeners added with addStatusListener.
inherited
-
didRegisterListener(
) → void -
This implementation ignores listener registrations.
inherited
-
didUnregisterListener(
) → void -
This implementation ignores listener registrations.
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
-
goToPhase(
P phase) → MotionFuture -
Jumps to
phasein the active timeline. -
inspectPlayback(
) → PlaybackSnapshot -
Available on TrackController, provided by the TrackControllerInspection extension
Builds a snapshot of the controller's current playback state. -
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
-
onPlaybackSettled(
) → void -
Called after every active track settles at the end of a non-looping
playback run.
override
-
onSyncReleased(
Object token) → void -
Called when a group of tracks is released past a sync barrier.
override
-
pause(
) → void -
Pauses playback without clearing track plans or changing status.
inherited
-
playPhases(
TrackPhaseTimeline< P> timeline, {P? atPhase, void onTransition(PhaseTransition<P> transition)?}) → MotionFuture -
Plays through all phases of
timeline, auto-advancing as each phase's steps complete. -
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
-
resetVelocityTracking(
) → void -
Clears velocity-tracking samples so future set calls start fresh.
inherited
-
resume(
) → void -
Resumes paused playback from each track's current local playhead.
inherited
-
resync(
TickerProvider vsync) → void -
Recreates the ticker using
vsync.inherited -
scrubTo(
Duration t) → void -
Evaluates retained track plans at
twithout starting the ticker.inherited -
set(
List< TrackValue< values) → voidObject> > -
Like TrackController.set.
override
-
setTimeline(
TrackPhaseTimeline< P> timeline, {void onTransition(PhaseTransition<P> transition)?}) → void - Sets the timeline without starting playback.
-
stop(
{List< Track< ? tracks, bool canceled = false}) → MotionFutureObject> > -
Stops the given
tracks, or all tracks whentracksis null.override -
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
-
trackedVelocityEstimate<
T extends Object> (Track< T> track) → MotionVelocityEstimate<T> ? -
Returns the tracked velocity estimate for
track, or null if velocity tracking is disabled or no samples have been recorded.inherited -
velocity<
T extends Object> (Track< T> track) → T -
Returns the current velocity for
track.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited