'How to make auto click event at any position on Screen in Flutter

I am trying make an auto Clicker app like this. I am suffering with making click at anywhere in the screen(both in inside app and also when the app is in background means on other apps). I used a dragable widget to hover a little circle on the screen. I want to make the click event where that circle is. Following is the code:

Positioned(
  top: height,
  left: width,
  child: Draggable(
    feedback: CirclePicture(),
    child: CirclePicture(),
    childWhenDragging: Container(),
    onDragEnd: (details) {
      setState(() {
        height = details.offset.dy;
        width = details.offset.dx;
      });
    },
  ),
)

This widget is in a stack, So I can easily move it inside the app. But I want to make click event the circle is in the app(also outside the app where only this circle will be visible). I tried following this answer on stackoverFlow but It didn't worked.

If anybody knows how to make the click event(anywhere in the screen) without being touched on screen by user then kindly answer this question.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source