sortAndRandom method

void sortAndRandom()

Implementation

void sortAndRandom() {
  data.sort((Announcement a, Announcement b) {
    final int compare = b.weight.compareTo(a.weight);
    final int compareRandom = b.randomWeight.compareTo(a.randomWeight);
    return compare == 0 ? compareRandom : compare;
  });
}