ForcePressDetails constructor Null safety

ForcePressDetails(
  1. {required Offset globalPosition,
  2. Offset? localPosition,
  3. required double pressure}
)

Creates details for a GestureForcePressStartCallback, GestureForcePressPeakCallback or GestureForcePressEndCallback.

The globalPosition argument must not be null.

Implementation

ForcePressDetails({
  required this.globalPosition,
  Offset? localPosition,
  required this.pressure,
}) : assert(globalPosition != null),
     assert(pressure != null),
     localPosition = localPosition ?? globalPosition;