How to make botton change direction after some time flutter

Viewed 70

I have to set 2 different direction for one botton amd this direction have to change in function of time. So when you first open the route, the botton lead to one route amd after some seconds the same botton lead to another route.

1 Answers

You can see example below to see how to do this.

import 'dart:async';
/// After 10 second
final timer = Timer.periodic(const Duration(seconds: 10), (timer) {
  /// change the sound to play
});

enter image description here

Related