onTick method

void onTick()

Called every time the timer reached a tick. The default implementation calls the closure received on the constructor and can be overridden to add custom logic.

Implementation

void onTick() {
  _onTick?.call();
}