makePeriodicTimer function

Timer makePeriodicTimer(
  1. Duration duration,
  2. void callback(
    1. Timer timer
    ), {
  3. bool fireNow = false,
})

Implementation

Timer makePeriodicTimer(
  Duration duration,
  void Function(Timer timer) callback, {
  bool fireNow = false,
}) {
  var timer = Timer.periodic(duration, callback);
  if (fireNow) {
    callback(timer);
  }

  return timer;
}