Spring class

A persistent spring animation that is based on response and damping fraction.

Mostly adapted from fluid_animations.

Inheritance
Annotations

Constructors

Spring.new({double durationSeconds = _defaultDurationSeconds, double bounce = 0})
Creates a spring with the specified duration and bounce.
const
Spring.withDamping({double dampingFraction = 1.0, double durationSeconds = _defaultDurationSeconds})
Creates a persistent spring that is based on duration and damping fraction.
const

Properties

bounce double
How bouncy the spring should be.
final
damping double
The damping coefficient (c).
finalinherited
dampingFraction double
The amount of drag applied to the value being animated, as a fraction of an estimate of amount needed to produce critical damping.
no setter
durationSeconds double
Defines the pace of the spring.
final
hashCode int
The hash code for this object.
no setteroverride
mass double
The mass of the spring (m).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stiffness double
The spring constant (k).
finalinherited

Methods

copyWith({double? bounce, double? durationSeconds}) Spring
Creates a new Spring with the specified properties.
copyWithDamping({double? dampingFraction, double? durationSeconds}) Spring
Creates a new Spring with the specified properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Constants

bouncy → const Spring
A spring with a predefined duration and higher amount of bounce.
defaultIOS → const Spring
A smooth spring with no bounce.
instant → const Spring
An effectively instant spring.
interactive → const Spring
A spring animation with a lower response value, intended for driving interactive animations.
snappy → const Spring
A spring with a predefined response and small amount of bounce that feels more snappy.