duration property

Duration get duration

Returns the total Duration based on the specified scenes.

Implementation

Duration get duration {
  var items = _generateAbsoluteItems().map((item) => item.end);

  int itemsDuration = items.sorted((a, b) => a.compareTo(b)).lastOrNull ?? 0;
  int scenesDuration = _scenes
          .map((scene) =>
              scene.begin.inMicroseconds + scene.duration.inMicroseconds)
          .sorted((a, b) => a.compareTo(b))
          .lastOrNull ??
      0;

  return Duration(microseconds: max(itemsDuration, scenesDuration));
}