minStatus function

ReportStatus? minStatus(
  1. ReportStatus? a,
  2. ReportStatus? b
)

Returns the lowest status of a and b ranked in the order of the enum.

Example: minStatus(ReportStatus.failed, ReportStatus.partial) == ReportStatus.partial.

Returns null when any of them is null (may be the case with old data).

Implementation

ReportStatus? minStatus(ReportStatus? a, ReportStatus? b) {
  if (a == null || b == null) return null;
  return ReportStatus.values[min(a.index, b.index)];
}