ScrollDragController constructor

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.

The delegate and details arguments must not be null.

Implementation

ScrollDragController({
  @required ScrollActivityDelegate delegate,
  @required DragStartDetails details,
  this.onDragCanceled,
  this.carriedVelocity,
  this.motionStartDistanceThreshold,
}) : assert(delegate != null),
     assert(details != null),
     assert(
       motionStartDistanceThreshold == null || motionStartDistanceThreshold > 0.0,
       'motionStartDistanceThreshold must be a positive number or null'
     ),
     _delegate = delegate,
     _lastDetails = details,
     _retainMomentum = carriedVelocity != null && carriedVelocity != 0.0,
     _lastNonStationaryTimestamp = details.sourceTimeStamp,
     _offsetSinceLastStop = motionStartDistanceThreshold == null ? null : 0.0;