SpringMotion class abstract
A motion based on spring physics.
SpringMotion implements a motion that follows physical spring behavior, using a SpringDescription to define its characteristics. This motion is useful for creating natural and responsive animations.
Spring motions continue until they naturally settle based on physics, rather than stopping at a predetermined time. A spring has ended after its perceptual duration, SpringDescription.duration, and settles later.
Constructors
- SpringMotion(SpringDescription description, {bool snapToEnd})
-
A motion based on spring physics.
constfactory
Properties
- description → SpringDescription
-
The physical description of the spring.
no setter
- duration → Duration?
-
The perceptual duration of the spring, SpringDescription.duration.
no setteroverride
- hashCode → int
-
Returns a hash code for this object.
no setteroverride
- needsSettle → bool
-
Whether this motion needs to settle.
no setteroverride
- 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.final - 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(
) → SpringMotion - Returns a copy of this spring motion.
-
createSimulation(
{double start = 0, double end = 1, double velocity = 0}) → Simulation -
Creates a spring simulation.
override
-
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
durationisduration.inherited -
toString(
) → String -
Returns a string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
Equality operator for SpringMotion.
override