IntervalDuration.delayed constructor

IntervalDuration.delayed({
  1. Duration? startDelay,
  2. Duration? endDelay,
  3. required Duration duration,
})

Implementation

factory IntervalDuration.delayed({
  Duration? startDelay,
  Duration? endDelay,
  required Duration duration,
}) {
  if (startDelay != null) {
    duration += startDelay;
  }
  if (endDelay != null) {
    duration += endDelay;
  }
  return IntervalDuration(
    start: startDelay,
    end: endDelay == null ? null : duration - endDelay,
    duration: duration,
  );
}