Home > Net >  Is there a way to access to pressure of a touch event in Dart?
Is there a way to access to pressure of a touch event in Dart?

Time:12-08

On Android, we can access the pressure of an event using getPressure, on iOS one can use the force property. But can we access these event properties also when using dart/flutter? If not, is there a work-around possible?

CodePudding user response:

In flutter you can use ForcePressGestureRecognizer

The interpolation function should give you the raw device pressure.

CodePudding user response:

I think you are looking for "ForcePressGestureRecognizer" using GestureDetector Widget, check below links:

https://api.flutter.dev/flutter/widgets/GestureDetector-class.html#onForcePressStart

https://api.flutter.dev/flutter/gestures/ForcePressGestureRecognizer-class.html

  • Related