toKeySet method
Returns a Set of the map keys.
The set will be sorted if the map's sort
configuration is true
,
or if you explicitly provide a compare
method.
Implementation
Set<K> toKeySet({int Function(K a, K b)? compare}) {
if (compare == null) {
return Set<K>.of(keys);
} else {
return toKeyList(compare: compare).toSet();
}
}