ForcePressGestureRecognizer constructor

  1. {double startPressure: 0.4,
  2. double peakPressure: 0.85,
  3. GestureForceInterpolation interpolation: _inverseLerp,
  4. Object debugOwner,
  5. PointerDeviceKind kind}

Creates a force press gesture recognizer.

The startPressure defaults to 0.4, and peakPressure defaults to 0.85 where a value of 0.0 is no pressure and a value of 1.0 is maximum pressure.

The startPressure, peakPressure and interpolation arguments must not be null. The peakPressure argument must be greater than startPressure. The interpolation callback must always return a value in the range 0.0 to 1.0 for values of pressure that are between pressureMin and pressureMax.

It's possible to limit this recognizer to a specific PointerDeviceKind by providing the optional kind argument. If kind is null, the recognizer will accept pointer events from all device kinds.


  this.startPressure = 0.4,
  this.peakPressure = 0.85,
  this.interpolation = _inverseLerp,
  Object debugOwner,
  PointerDeviceKind kind,
}) : assert(startPressure != null),
     assert(peakPressure != null),
     assert(interpolation != null),
     assert(peakPressure > startPressure),
     super(debugOwner: debugOwner, kind: kind);