maxItem property

Get the maximum item in the list, equivalent to calling LIST_MAX(list) in ink.

Implementation

MapEntry<InkListItem, int> get maxItem {
  var max = MapEntry<InkListItem, int>(InkListItem(), 0);

  for (var entry in entries) {
    if (max.key.isNull || entry.value > max.value) {
      max = entry;
    }
  }

  return max;
}