call method
Implementation
void call(Function fn, [Duration delay = const Duration(milliseconds: 1000)]) {
if (_interval != null) {
_nextFn = fn;
return;
}
_interval = Timer.periodic(delay, (timer) {
if (_nextFn == null) {
cancel();
return;
}
_nextFn!();
_nextFn = null;
});
fn();
}