In Android, we have Handler.post() method which can run after every fixed time interval like this.

Handler handler = new Handler();

handler.post(new Runnable() {
  public void run() {
  // ... this runs after every second 
  handler.postDelayed(this, 1000); // makes run() run after every 1000 ms
  }
}

Do we have anything similar in Dart or Flutter?

PS: The similar of Handler.postDelayed() is Future.delayed(). I am asking for Handler.post()


Solution 1: user6274128

I found that. Timer.periodic() is the one I should be using.

Timer.periodic(Duration(microseconds: 1000), (_) {
   // Runs after every 1000ms
});