latestPeriod property

Period? get latestPeriod

Latest period that has a course (accounting for span), or null if empty.

Implementation

Period? get latestPeriod => isEmpty
    ? null
    : entries
          .expand((e) => e.periods)
          .reduce((a, b) => a.index > b.index ? a : b);