toEntrySet method

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

Returns a Set of the map entries. The set will be sorted if the map's sort configuration is true, or if you explicitly provide a compare method.

Implementation

Set<MapEntry<K, V>> toEntrySet({int Function(MapEntry<K, V> a, MapEntry<K, V> b)? compare}) {
  if (compare == null) {
    return Set<MapEntry<K, V>>.of(entries);
  } else {
    return toEntryList(compare: compare).toSet();
  }
}