tick property

int get tick

The number of times the timer has fired.

For one-time timers (created with Timer), this will be 0 before firing and 1 after firing.

For periodic timers (created with Timer.periodic), this increments each time the callback is invoked.

Example:

final timer = Timer.periodic(Duration(seconds: 1), (t) {
  print('Tick ${t.tick}');
}).withLifecycle(this);

// Later, check how many times it has fired
print('Timer has fired ${timer.tick} times');

Implementation

int get tick => _timer.tick;