DragEndDetails constructor

DragEndDetails({
  1. Velocity velocity = Velocity.zero,
  2. double? primaryVelocity,
  3. Offset globalPosition = Offset.zero,
  4. Offset? localPosition,
})

Creates details for a GestureDragEndCallback.

If primaryVelocity is non-null, its value must match one of the coordinates of velocity.pixelsPerSecond and the other coordinate must be zero.

Implementation

DragEndDetails({
  this.velocity = Velocity.zero,
  this.primaryVelocity,
  this.globalPosition = Offset.zero,
  Offset? localPosition,
}) : assert(
       primaryVelocity == null
         || (primaryVelocity == velocity.pixelsPerSecond.dx && velocity.pixelsPerSecond.dy == 0)
         || (primaryVelocity == velocity.pixelsPerSecond.dy && velocity.pixelsPerSecond.dx == 0),
     ),
    localPosition = localPosition ?? globalPosition;