Handling multitouch in flutter

3,273

Looks like you are looking for MultiDragGestureRecognizer. Look into this thread to know more.

Edit : There is no direct widget that you can use. You'll need to create a StatefulWidget that instantiates the MultiDragGestureRecognizer, then have your build function have a Listener that routes the onPointerDown event to the recognizer.

Share:
3,273
Michael Kanzieper
Author by

Michael Kanzieper

Updated on December 07, 2022

Comments

  • Michael Kanzieper
    Michael Kanzieper over 1 year

    In flutter, there is a standard GestureDetector that allows to interprets the commands "touch down", "touch move" and "touch up" by means of the corresponding handlers:

    • onPanStart: _handlePanStart,
    • onPanUpdate: _handlePanUpdate,
    • onPanEnd: _handlePanEnd,

    However, we are talking about processing a single touch, but what if I want to handle several parallel touches and movements? I.e. really use multitouch? Is there any kind of built-in control in flutter (maybe multitouch gesture detector, I don't known) that allows to get a vector or a list of events of clicks, movements, ups with ids of touches and their current coordinates?

    • pskink
      pskink over 5 years
      see Listener class (and its onPointer* properties) or you simply need GestureDetector#onScale* properties?