Motion class abstract

A motion pattern such as spring physics or duration-based curves.

Motion provides a foundation for creating various types of animation behaviors. Concrete implementations of this class define specific motion patterns like spring physics or duration-based curves.

Available extensions
Annotations

Constructors

Motion({Tolerance tolerance = Tolerance.defaultTolerance})
A motion pattern such as spring physics or duration-based curves.
const
Motion.bouncySpring({Duration duration, double extraBounce, bool snapToEnd})
A spring animation with a predefined duration and higher amount of bounce.
const
factory
Motion.cupertino({Duration duration, double bounce, bool snapToEnd})
A collection of spring motions that are commonly used in Cupertino apps.
const
factory
Motion.curved(Duration duration, [Curve curve])
A motion based on a fixed duration and curve.
const
factory
Motion.customSpring(SpringDescription spring)
A motion based on spring physics.
const
factory
Motion.interactiveSpring({Duration duration, double extraBounce, bool snapToEnd})
A spring animation with a lower response value, intended for driving interactive animations.
const
factory
Motion.linear(Duration duration)
Creates a linear motion with a fixed duration.
const
factory
Motion.none([Duration duration])
A motion that holds at the current value for duration and never reaches its target.
const
factory
Motion.smoothSpring({Duration duration, double extraBounce, bool snapToEnd})
A smooth spring animation with a predefined duration and no bounce.
const
factory
Motion.snappySpring({Duration duration, double extraBounce, bool snapToEnd})
A spring animation with a predefined duration and small amount of bounce that feels more snappy.
const
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
needsSettle → bool
Whether this motion needs to settle.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
toCurve → MotionCurve

Available on Motion, provided by the CurveConversion extension

Converts a Motion to a MotionCurve.
no setter
tolerance → Tolerance
The tolerance for this motion.
final
unboundedWillSettle → bool
Whether this motion will settle without bounds.
no setter

Methods

createSimulation({double start = 0, double end = 1, double velocity = 0}) → Simulation
Creates a simulation for this motion.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
segment({required double length, double start = 0.0}) → TrimmedMotion

Available on Motion, provided by the MotionTrimming extension

Creates a TrimmedMotion that uses a sub-extent of this motion.
sliced({double from = 0.0, double to = 1.0}) → TrimmedMotion

Available on Motion, provided by the MotionTrimming extension

Creates a TrimmedMotion that represents a slice of this motion.
toCurveWithVelocity(double velocity) → MotionCurve

Available on Motion, provided by the CurveConversion extension

Converts a Motion to a MotionCurve with an initial velocity.
toString() → String
A string representation of this object.
inherited
trimmed({double fromStart = 0.0, double fromEnd = 0.0}) → TrimmedMotion

Available on Motion, provided by the MotionTrimming extension

A motion that uses only a portion of another motion's characteristic curve.

Operators

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