FixedExtentScrollPhysics class

A snapping physics that always lands directly on items instead of anywhere within the scroll extent.

Behaves similarly to a slot machine wheel except the ballistics simulation never overshoots and rolls back within a single item if it's to settle on that item.

Must be used with a scrollable that uses a FixedExtentScrollController.

Defers back to the parent beyond the scroll extents.

Inheritance

Constructors

FixedExtentScrollPhysics({ScrollPhysics parent })
Creates a scroll physics that always lands on items.
const

Properties

allowImplicitScrolling → bool
Whether a viewport is allowed to change its scroll position implicitly in responds to a call to RenderObject.showOnScreen. [...]
read-only, inherited
dragStartDistanceMotionThreshold → double
The minimum amount of pixel distance drags must move by to start motion the first time or after each time the drag motion stopped. [...]
read-only, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
maxFlingVelocity → double
Scroll fling velocity magnitudes will be clamped to this value.
read-only, inherited
minFlingDistance → double
The minimum distance an input pointer drag must have moved to to be considered a scroll fling gesture. [...]
read-only, inherited
minFlingVelocity → double
The minimum velocity for an input pointer drag to be considered a scroll fling. [...]
read-only, inherited
parent ScrollPhysics
If non-null, determines the default behavior for each method. [...]
final, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
spring SpringDescription
The spring to use for ballistic simulations.
read-only, inherited
tolerance Tolerance
The tolerance to use for ballistic simulations.
read-only, inherited

Methods

applyTo(ScrollPhysics ancestor) FixedExtentScrollPhysics
If parent is null then return a ScrollPhysics with the same runtimeType where the parent has been replaced with the ancestor. [...]
createBallisticSimulation(ScrollMetrics position, double velocity) Simulation
Returns a simulation for ballistic scrolling starting from the given position with the given velocity. [...]
applyBoundaryConditions(ScrollMetrics position, double value) → double
Determines the overscroll by applying the boundary conditions. [...]
inherited
applyPhysicsToUserOffset(ScrollMetrics position, double offset) → double
Used by DragScrollActivity and other user-driven activities to convert an offset in logical pixels as provided by the DragUpdateDetails into a delta to apply (subtract from the current position) using ScrollActivityDelegate.setPixels. [...]
inherited
buildParent(ScrollPhysics ancestor) ScrollPhysics
If parent is null then return ancestor, otherwise recursively build a ScrollPhysics that has ancestor as its parent. [...]
@protected, inherited
carriedMomentum(double existingVelocity) → double
Returns the velocity carried on repeated flings. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
shouldAcceptUserOffset(ScrollMetrics position) → bool
Whether the scrollable should let the user adjust the scroll offset, for example by dragging. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited