BouncingScrollSimulation class
An implementation of scroll physics that matches iOS.
See also:
- ClampingScrollSimulation, which implements Android scroll physics.
- Inheritance
-
- Object
- Simulation
- BouncingScrollSimulation
Constructors
- BouncingScrollSimulation.new({required double position, required double velocity, required double leadingExtent, required double trailingExtent, required SpringDescription spring, double constantDeceleration = 0, 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.
no setterinherited
- 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.
no setterinherited
- 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".
getter/setter pairinherited
- 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 nonexistent 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.