toKeyList method
Returns a List of the map keys.
The list will be sorted if the map's sort
configuration is true
,
or if you explicitly provide a compare
method.
Implementation
List<K> toKeyList({int Function(K a, K b)? compare}) {
var result = List.of(keys);
if (compare != null || config.sort) result.sort(compare);
return result;
}