CupertinoMotion class

A collection of spring motions that are commonly used in Cupertino apps.

Inheritance
Available extensions

Constructors

CupertinoMotion({Duration duration = const Duration(milliseconds: 500), double bounce = 0, bool snapToEnd = true})
Creates a new CupertinoMotion with the specified duration and bounce.
const
CupertinoMotion.bouncy({Duration duration = const Duration(milliseconds: 500), double extraBounce = 0.0, bool snapToEnd = true})
A spring animation with a predefined duration and higher amount of bounce.
const
CupertinoMotion.interactive({Duration duration = const Duration(milliseconds: 150), double extraBounce = 0.0, bool snapToEnd = true})
A spring animation with a lower response value, intended for driving interactive animations.
const
CupertinoMotion.smooth({Duration duration = const Duration(milliseconds: 500), double extraBounce = 0.0, bool snapToEnd = true})
A smooth spring animation with a predefined duration and no bounce.
const
CupertinoMotion.snappy({Duration duration = const Duration(milliseconds: 500), double extraBounce = 0.0, bool snapToEnd = true})
A spring animation with a predefined duration and small amount of bounce that feels more snappy.
const

Properties

bounce → double
The bounce of the spring motion.
final
description → SpringDescription
The physical description of the spring.
no setteroverride
duration → Duration
The perceptual duration of the spring motion: its pace, the undamped period.
final
hashCode → int
Returns a hash code for this object.
no setterinherited
needsSettle → bool
Whether this motion needs to settle.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
snapToEnd → bool
Whether the spring jumps to its end value, the target, once it is within tolerance, so that it settles exactly on it.
finalinherited
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: how close to its target and to rest it has to be to count as settled.
finalinherited
unboundedWillSettle → bool
Whether this motion will settle without bounds.
no setterinherited

Methods

copyWith({Duration? duration, double? bounce, bool? snapToEnd}) → CupertinoMotion
Creates a new CupertinoMotion with the same properties as this one, but with the specified bounce and duration.
override
createSimulation({double start = 0, double end = 1, double velocity = 0}) → Simulation
Creates a spring simulation.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scaleTo(Duration duration) → Motion
Returns this motion retimed so that its duration is duration.
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
Returns 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
Equality operator for SpringMotion.
inherited