ExponentialDecay class
Exponential velocity decay via FrictionSimulation.
decayPerSecond ∈ 0, 1 is the fraction of velocity lost per second.
0 → never decays, 1 → instant stop.
Constructors
- ExponentialDecay(double decayPerSecond, {double endVelocity = 60})
-
const
- ExponentialDecay.halfLife(Duration t, {double endVelocity = 60})
-
Velocity half-life — the time for velocity to halve.
factory
- ExponentialDecay.imageViewer({double endVelocity = 60})
-
Image-viewer feel — brief, image-sized fling with a visible tail.
const
- ExponentialDecay.iosFast({double endVelocity = 60})
-
iOS
.fast/ paging feel — snappier (per-frame 0.99 @ 60fps).const - ExponentialDecay.iosScroll({double endVelocity = 60})
-
iOS scrollview feel — long fling (per-frame 0.998 @ 60fps).
const
- ExponentialDecay.none({double endVelocity = 60})
-
Velocity is killed at release — no fling at all.
const
- ExponentialDecay.perFrame(double multiplier, {double fps = 60, double endVelocity = 60})
-
Per-frame velocity multiplier (iOS / JS conventions). 60fps default.
factory
Properties
- decayPerSecond → double
-
Fraction of velocity lost per second.
final
- endVelocity → double
-
Velocity (logical px/s) at which the decay phase ends. Higher = snappier
handoff to settle; lower = more "complete" tail. Default 60 ≈ 1 px/frame
at 60 Hz, the inter-frame visibility threshold.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
simulationAt(
{required double position, required double velocity}) → Simulation -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited