sortLogs function

int sortLogs(
  1. LogOption a,
  2. LogOption b
)

Sort logs by modified date (newest first), then created date.

Implementation

int sortLogs(LogOption a, LogOption b) {
  final modCompare = b.modified.compareTo(a.modified);
  if (modCompare != 0) return modCompare;
  return b.created.compareTo(a.created);
}