filter method Null safety

KtMap<K, V> filter(
  1. bool predicate(
    1. KtMapEntry<K, V> entry

Returns a new map containing all key-value pairs matching the given predicate.

The returned map preserves the entry iteration order of the original map.


KtMap<K, V> filter(bool Function(KtMapEntry<K, V> entry) predicate) {
  final filtered = filterTo(linkedMapFrom<K, V>(), predicate);
  // TODO ping dort-lang/sdk team to check type bug
  return filtered;