minMax method
Returns the minimum and maximum of this Iterable at once. The elements
need to be Comparable, unless a custom comparator
is provided.
Throws a StateError if the iterable is empty, unless an orElse
function is provided.
For example:
print([3, 1, 2].minMax()); // (min: 1, max: 3)
Implementation
({E min, E max}) minMax({
Comparator<E>? comparator,
({E min, E max}) Function()? orElse,
}) => (comparator ?? naturalCompare).minMaxOf(this, orElse: orElse);