SortedList<E>.of constructor

SortedList<E>.of(
  1. Iterable<E> iterable, {
  2. Comparator<E>? comparator,
  3. bool growable = true,
})

Constructs a sorted-list from an iterable with an optional ordering.

Implementation

SortedList.of(Iterable<E> iterable,
    {Comparator<E>? comparator, bool growable = true})
    : _values = List<E>.of(iterable, growable: growable),
      _comparator = comparator ?? naturalCompare {
  _comparator.sort(_values);
}