DragEndDetails constructor Null safety

DragEndDetails(
  1. {Velocity velocity = Velocity.zero,
  2. double? primaryVelocity}
)

Creates details for a GestureDragEndCallback.

The velocity argument must not be null.

Implementation

DragEndDetails({
  this.velocity = Velocity.zero,
  this.primaryVelocity,
}) : assert(velocity != null),
     assert(
       primaryVelocity == null
         || primaryVelocity == velocity.pixelsPerSecond.dx
         || primaryVelocity == velocity.pixelsPerSecond.dy,
     );