BouncingScrollSimulation class Null safety

An implementation of scroll physics that matches iOS.

See also:

Inheritance

Constructors

BouncingScrollSimulation({required double position, required double velocity, required double leadingExtent, required double trailingExtent, required SpringDescription spring, Tolerance tolerance = Tolerance.defaultTolerance})
Creates a simulation group for scrolling on iOS, with the given parameters.

Properties

hashCode int
The hash code for this object.
read-onlyinherited
leadingExtent double
When x falls below this value the simulation switches from an internal friction model to a spring model which causes x to "spring" back to leadingExtent.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
spring SpringDescription
The spring used to return x to either leadingExtent or trailingExtent.
final
tolerance Tolerance
How close to the actual end of the simulation a value at a particular time must be before isDone considers the simulation to be "done".
read / writeinherited
trailingExtent double
When x exceeds this value the simulation switches from an internal friction model to a spring model which causes x to "spring" back to trailingExtent.
final

Methods

dx(double time) double
The velocity of the object in the simulation at the given time.
override
isDone(double time) bool
Whether the simulation is "done" at the given time.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
x(double time) double
The position of the object in the simulation at the given time.
override

Operators

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

Constants

maxSpringTransferVelocity → const double
The maximum velocity that can be transferred from the inertia of a ballistic scroll into overscroll.
5000.0