motor library
A unified motion system for Flutter - physics-based springs and duration-based curves under one API.
Classes
- AlignmentMotionConverter
- A MotionConverter for Alignment values.
- AngleMotionConverter
- A MotionConverter for angles in radians, animated the short way round.
-
BoundedMotionController<
T extends Object> - A MotionController that is bounded.
- BoundedSingleMotionController
- A SingleMotionController that is bounded.
- ColorRgbMotionConverter
- A MotionConverter for Color values that interpolates in RGB space.
- CupertinoMotion
- A collection of spring motions that are commonly used in Cupertino apps.
- CurvedMotion
- A motion based on a fixed duration and curve.
- EdgeInsetsDirectionalMotionConverter
- A MotionConverter for EdgeInsetsDirectional values.
- EdgeInsetsMotionConverter
- A MotionConverter for EdgeInsets values.
- FixedDurationFreeMotion
- A free motion that plays all of parent in exactly duration.
- FixedDurationMotion
- A target-based motion that plays parent faster or slower, so that its duration is duration.
- FreeMotion
- A self-directed motion that does not require an end value.
- FrictionMotion
- A free motion that decelerates due to fluid drag (friction).
- LinearMotion
- A convenience class for a CurvedMotion that uses a linear curve.
- MaterialSpringMotion
- Material Design 3 spring motion tokens.
- Motion
- A motion from a start value to an end value.
- MotionBase
- The sealed root of all motions.
-
MotionBuilder<
T extends Object> - A widget that animates a value using a dynamic motion.
-
MotionController<
T extends Object> - A base MotionController that can manage a Motion of any value that you can pass a MotionConverter for.
-
MotionConverter<
T> - A converter that handles normalization and denormalization of values for motion controllers.
- MotionCurve
- A Curve that is represented by a Motion.
- MotionDimension
- How one normalized dimension of a MotionConverter behaves.
- MotionFuture
-
The future of one animation started on a controller:
awaitit until the animation has settled, or await ended until it has ended. -
MotionSequence<
P, T extends Object> - A sequence of phases that smoothly animate between property values.
-
MotionVelocityEstimate<
T> - A velocity estimate from recent position samples.
-
MotionVelocityTracker<
T> -
Tracks velocity for values of type
Tduring user interactions. - NoMotion
- A motion that holds at the current value for duration and never reaches its target.
- OffsetMotionConverter
- A MotionConverter for Offset values.
-
PhaseSettled<
P> - The animation has settled: it is at rest at phase.
-
PhaseTrackBuilder<
P extends Object> - Builds a widget from phase-driven track values.
-
PhaseTrackController<
P extends Object> - A TrackController extension that understands phases.
-
PhaseTransition<
P> - A phase transition reported while a phased animation plays.
-
PhaseTransitioning<
P> - The animation is moving from one phase to the next.
- RectMotionConverter
- A MotionConverter for Rect values.
-
SequenceMotionBuilder<
P, T extends Object> - Animates through a MotionSequence with smooth phase transitions.
-
SequenceMotionController<
P, T extends Object> - A motion controller that adds the capability to play motion sequences.
- SingleMotionBuilder
- A MotionBuilder that animates a single double value.
- SingleMotionController
- A controller that manages a single-dimensional motion.
- SingleMotionConverter
- A MotionConverter for double values.
-
SingleMotionPhaseSequence<
P, T extends Object> - A phase sequence that wraps a parent uses a single motion for all of its transitions.
- SingleVelocityMotionBuilder
- A VelocityMotionBuilder that animates a single double value.
- SizeMotionConverter
- A MotionConverter for Size values.
-
SpanningSequence<
T extends Object> - A sequence where a single motion spans across positioned phases.
- SpringMotion
- A motion based on spring physics.
-
StateSequence<
P, T extends Object> - A sequence using named phases mapped to values.
-
StepAt<
T extends Object> - A keyframe: reaches value exactly at at.
-
StepFree<
T extends Object> - A step that runs a self-directed motion.
-
StepHold<
T extends Object> - A step that holds the current value.
-
StepLoop<
T extends Object> - A step that repeats steps according to mode.
-
StepSequence<
T extends Object> - A sequence that steps through values by index (0, 1, 2...).
-
StepSync<
T extends Object> - A synchronization barrier that keeps sibling tracks aligned.
-
StepTo<
T extends Object> - A step that animates toward value.
- TickerRate
-
Configures how a
FixedTickerschedules callbacks. - TickerRateScope
- Provides a TickerRate to the widget subtree.
-
Track<
T extends Object> - Identity for a single animated property (e.g. a panel's size or a tint).
-
TrackAnimation<
T extends Object> - An animation instruction for a single Track.
- TrackBuilder
- Declaratively plays multiple TrackAnimations on one ticker.
- TrackController
- Controls multi-track animations from a single ticker.
-
TrackPhaseTimeline<
P extends Object> - A multi-track timeline organized by phases.
-
TrackStep<
T extends Object> - A single instruction in a track animation.
-
TrackValue<
T extends Object> - A value snapshot for a Track.
- TrimmedMotion
- A motion that uses only a portion of another motion's characteristic curve.
-
VelocityMotionBuilder<
T extends Object> - A widget that animates a value using a dynamic motion.
- VelocityTracking
- Controls velocity tracking behavior in a MotionController.
Enums
- LoopMode
- How a TrackStep.loop or TrackPhaseTimeline repeats.
- WaitUntil
- What the step after a TrackStep.to or TrackStep.free waits for before it starts.
Mixins
-
ComparableMotionConverter<
T extends Comparable> - Adds compare implementation to a MotionConverter for types that implement Comparable.
-
DirectionalMotionConverter<
T> - A MotionConverter that provides additional information about whether a motion is forward or backwards by exposing a compare method.
-
FixedTickerProviderStateMixin<
T extends StatefulWidget> -
A mixin on State that can create multiple
FixedTickers with a configurable tickerRate. - SettlingSimulation
- A Simulation that knows when it settles.
-
SingleFixedTickerProviderStateMixin<
T extends StatefulWidget> -
A mixin on State that creates a single
FixedTickerwith a configurable tickerRate.
Extension Types
- TrackValueReader
- Reads the current value of a Track: call it with the track.
Extensions
- CurveConversion on Motion
- Converts a Motion to a MotionCurve.
-
IterableConversionX
on Iterable<
T> - Extension methods for creating sequences from lists.
-
IterableMotionConversionX
on Iterable<
ValueWithMotion< T> > - Extension methods for creating step sequences from value-motion pairs.
-
MapConversionX
on Map<
P, T> - Extension methods for creating state sequences from maps.
-
MapDoubleConversionX
on Map<
P, T> - Extension methods for creating spanning sequences from position maps.
- MotionTrimming on Motion
- Extension methods for Motion to provide convenient trimming functionality.
-
SequenceModificationX
on MotionSequence<
P, T> - Provides methods to modify a given MotionSequence.
- SimulationSettling on Simulation
- When a Simulation settles, whether or not it knows.
Typedefs
-
Denormalize<
T> = T Function(List< double> values) -
A function that converts a list of double values back to a value of type
T. -
Normalize<
T> = List< double> Function(T value) -
A function that converts a value of type
Tto a list of double values. -
PhaseTrackWidgetBuilder<
P> = Widget Function(BuildContext context, TrackValueReader value, P phase, Widget? child) - Builds a widget from phase-driven track values.
-
SequenceWidgetBuilder<
P, T extends Object> = Widget Function(BuildContext context, T value, P phase, Widget? child) - A function that builds a widget based on the current phase and interpolated value.
- TrackWidgetBuilder = Widget Function(BuildContext context, TrackValueReader value, Widget? child)
- Builds a widget from a multi-track animation.
-
ValueWithMotion<
T> = (T, Motion) - A value and its associated motion.
-
VelocityMotionWidgetBuilder<
T> = Widget Function(BuildContext context, T value, T velocity, Widget? child) - Builds a Widget when given a concrete value and velocity of a Motion.