TimerModel constructor

TimerModel({
  1. required Duration timeout,
  2. Duration interval = const Duration(seconds: 1),
})

Creates a new timer model.

timeout is the duration to count down from. interval is how often the timer ticks (defaults to 1 second).

Implementation

TimerModel({
  required this.timeout,
  this.interval = const Duration(seconds: 1),
}) : _running = false,
     _id = _nextTimerId(),
     _tag = 0;