sortAlbumMediaDates static method

List<Medium> sortAlbumMediaDates(
  1. List<Medium> mediumList
)

Implementation

static List<Medium> sortAlbumMediaDates(List<Medium> mediumList) {
  mediumList.sort((a, b) {
    if (a.lastDate == null) {
      return 1;
    } else if (b.lastDate == null) {
      return -1;
    } else {
      return b.lastDate!.compareTo(a.lastDate!);
    }
  });
  return mediumList;
}