ScrollDragController class

Scrolls a scroll view as the user drags their finger across the screen.

See also:

  • DragScrollActivity, which is the activity the scroll view performs while a drag is underway.
Implemented types

Constructors

ScrollDragController({@required ScrollActivityDelegate delegate, @required DragStartDetails details, VoidCallback onDragCanceled, double carriedVelocity, double motionStartDistanceThreshold })
Creates an object that scrolls a scroll view as the user drags their finger across the screen. [...]

Properties

carriedVelocity double
Velocity that was present from a previous ScrollActivity when this drag began.
final
delegate ScrollActivityDelegate
The object that will actuate the scroll view as the user drags.
read-only
lastDetails → dynamic
The most recently observed DragStartDetails, DragUpdateDetails, or DragEndDetails object.
read-only
motionStartDistanceThreshold double
Amount of pixels in either direction the drag has to move by to start scroll movement again after each time scrolling came to a stop.
final
onDragCanceled VoidCallback
Called when dispose is called.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

cancel() → void
The input from the pointer is no longer directed towards this receiver. [...]
override
dispose() → void
Called by the delegate when it is no longer sending events to this object.
@mustCallSuper
end(DragEndDetails details) → void
The pointer is no longer in contact with the screen. [...]
override
toString() String
Returns a string representation of this object.
override
update(DragUpdateDetails details) → void
The pointer has moved.
override
updateDelegate(ScrollActivityDelegate value) → void
Updates the controller's link to the ScrollActivityDelegate. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

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

Constants

momentumRetainStationaryDurationThreshold → const Duration
Maximum amount of time interval the drag can have consecutive stationary pointer update events before losing the momentum carried from a previous scroll activity.
const Duration(milliseconds: 20)
motionStoppedDurationThreshold → const Duration
Maximum amount of time interval the drag can have consecutive stationary pointer update events before needing to break the motionStartDistanceThreshold to start motion again.
const Duration(milliseconds: 50)