sortWith static method

List<AdItem> sortWith(
  1. List<AdItem> items,
  2. int comparator(
    1. AdItem,
    2. AdItem
    )
)

Sort with custom comparator

Implementation

static List<AdItem> sortWith(List<AdItem> items, int Function(AdItem, AdItem) comparator) {
  final sorted = List<AdItem>.from(items);
  sorted.sort(comparator);
  return sorted;
}