top method

List<T> top(
  1. int n
)

Returns the n largest elements in descending order.

Implementation

List<T> top(int n) => (toList()..sort()).reversed.take(n).toList();