descending property

  1. @useResult
List<E> get descending

A list sorted in descending order of values returned by this Order's function.

Example

final list = [('b', 1), ('a', 2), ('c', 3)];
list.order(by: (e) => e.$1).ascending; // [('a', 2), ('b', 1), ('c', 3)]

Implementation details

Computing values is assumed to be cheap. Hence, the values are recomputed each time rather than cached.

Implementation

@useResult List<E> get descending => _iterable.toList()..sort((a, b) => _function(b).compareTo(_function(a)));