cancel method

void cancel()

Cancels a pending scheduled callback, if any.

Implementation

void cancel() => timer?.cancel();