timer method

Timer timer([
  1. Function? function
])

Timer

Implementation

Timer timer([Function? function]) {
  late Timer timer;
  timer = Timer(this, () {
    if (function != null) function.call();
    timer.cancel();
  });
  return timer;
}