toKeySet method

Set<K> toKeySet({
  1. int compare(
    1. K a,
    2. K b
    )?,
})

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();
  }
}