minStatus function

  1. @Deprecated('The method will be removed from public API.')
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

@Deprecated('The method will be removed from public API.')
ReportStatus? minStatus(ReportStatus? a, ReportStatus? b) {
  if (a == null || b == null) return null;
  return ReportStatus.values[min(a.index, b.index)];
}