toValueList method
Returns a List of the map values.
If sort
is true, then the list will be sorted with compare
, if
provided, or with compareObject if not provided. If sort
is
false, compare
will be ignored.
Implementation
List<V> toValueList({
bool sort = false,
int Function(V a, V b)? compare,
}) {
assert(compare == null || sort == true);
var result = List.of(values);
if (sort) result.sort(compare ?? compareObject);
return result;
}