duration property

Duration? duration

A duration (difference) between start and end if both are available.

Implementation

Duration? get duration {
  final s = startTime;
  final e = endTime;
  return s != null && e != null ? e.difference(s) : null;
}