run method

dynamic run(
  1. VoidCallback action
)

Run the action after the duration

Implementation

run(VoidCallback action) {
  if (_timer != null && (_timer?.isActive ?? false)) {
    _timer?.cancel();
  }
  _timer = Timer(duration, action);
}