toKeyIList method

IList<K> toKeyIList({
  1. int compare(
    1. K? a,
    2. K? b
    )?,
  2. ConfigList? config,
})

Returns an IList of the map keys.

Optionally, you may provide a config for the list.

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

Implementation

IList<K> toKeyIList({
  int Function(K? a, K? b)? compare,
  ConfigList? config,
}) {
  var result = IList.withConfig(keys, config ?? IList.defaultConfig);
  if (compare != null || this.config.sort) result = result.sort(compare);
  return result;
}