RunningNornsTimer constructor

RunningNornsTimer({
  1. required NornsTimer timer,
  2. required NornsDuration startedAt,
})

Implementation

RunningNornsTimer({
  required this.timer,
  required this.startedAt,
}) {
  final NornsDuration endAt;
  if (timer.duration != null) {
    endAt = startedAt + timer.duration!;
  } else {
    endAt = NornsDuration.max;
  }
  _points.addAll([
    NornsPoint(point: startedAt, type: NornsPointType.timerStart),
    if (timer.points != null)
      ...timer.points!.map((e) => e.shiftWith(startedAt)),
    NornsPoint(
      point: endAt,
      type: NornsPointType.timerEnd,
    ),
  ]);
}