3

I want to draw on screen only when the stylus pen device is used and should not detect any finger input in flutter Here is the image

I am using this package https://pub.dev/packages/painter. please help me thanks in advance

1 Answers1

0

You can use Listener class.

handleTouchEvent(event){

    if (event.kind == PointerDeviceKind.stylus){
      ////
    }

};

Listener(
      onPointerDown:handleTouchEvent ,
      onPointerUp:handleTouchEvent,
      onPointerMove:handleTouchEvent
      child: child,
);
Youssef Maouche
  • 175
  • 1
  • 2
  • 10
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 13 '22 at 01:00