TimerLabelController constructor

TimerLabelController({
  1. required Duration duration,
  2. VoidCallback? onTimerEnd,
  3. bool alwaysShowHours = false,
})

Creates a TimerLabelController with the specified duration.

To start the countdown, call startTimer. Optionally, provide an onTimerEnd callback and set alwaysShowHours to true to always show the hours in the formatted time.

Implementation

TimerLabelController({
  required this.duration,
  this.onTimerEnd,
  this.alwaysShowHours = false,
}) {
  _secondsRemaining = duration.inSeconds;
}