Can a Auto Clicker app be developed in flutter?

Viewed 676

Is this possible to create an auto clicker app like Click Mate? in flutter? If yes then where should I start from? and if no then why not? Auto clicker apps are basically some apps that stimulate fake touch on some fixed or user-defined areas.

Edit: The hardest part here for me is to perform a click even outside the app. It seems an impossible task and the worse thing is, I can't find any guide about this.

1 Answers

In simple, You can either use Future.delayed or Timer to do this. Future.delayed example

Future _delayedFuture = Future.delayed(
  const Duration(milliseconds: 500),
  () {
    // Call some function after a delay of 500ms
  },
);

Future.delayed cannot be cancelled, while timer can be.

Timer example:

Timer _timer = Timer(
  const Duration(milliseconds: 500),
  () {
    // Call some function after a delay of 500ms
  },
);

If you want to cancel timer, use

_timer.cancel()

You can also run timer periodically, by using

Timer.periodic();

Related