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.
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.
LinearMotion
A convenience class for a CurvedMotion that uses a linear curve.
MaterialSpringMotion
Material Design 3 spring motion tokens for expressive design system.
Motion
A motion pattern such as spring physics or duration-based curves.
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.
MotionDraggable<T extends Object>
A widget that works like Draggable but with a Motion-based animation upon return.
MotionSequence<P, T extends Object>
A sequence of phases that smoothly animate between property values.
NoMotion
A motion that holds at the current value for duration and never reaches its target.
OffsetMotionConverter
A MotionConverter for Offset values.
PhaseSettled<P>
Represents a settled state where the animation has completed and is at rest at a specific phase.
PhaseTransition<P>
Represents the different states of phase transitions in a sequence animation.
PhaseTransitioning<P>
Represents an animating state where the animation is transitioning from one phase to another.
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 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 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.
StepSequence<T extends Object>
A sequence that steps through values by index (0, 1, 2...).
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.

Enums

LoopMode
The mode in which the phase animation should loop.

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.

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 T to a list of double 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.
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.