sorted abstract method

GenericStream<T> sorted([
  1. int comparator(
    1. T,
    2. T
    )?
])

Returns a stream consisting of the elements of this stream, sorted according to natural order.

Example

final sorted = GenericStream.of([3, 1, 4, 1, 5])
    .sorted();

Implementation

GenericStream<T> sorted([int Function(T, T)? comparator]);