sortAlbumMediaDates method

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

Implementation

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 a.lastDate!.compareTo(b.lastDate!);
    }
  });
  return mediumList;
}