toEntryList method

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

Returns a List of the map entries.

The list will be sorted if the map's sort configuration is true, or if you explicitly provide a compare method.

Implementation

List<MapEntry<K, V>> toEntryList({int Function(MapEntry<K, V> a, MapEntry<K, V> b)? compare}) {
  var result = List<MapEntry<K, V>>.of(entries);
  if (compare != null || config.sort) result.sort(compare ?? compareObject);
  return result;
}