MapExtension<K, V> extension

Extension for Map<K, V>.

on

Methods

copy() Map<K, V>
Copies this Map.
equalsKeysValues(Iterable<K> keys, Map<K, V> other) bool
Returns true if other have keys of equals value.
filterKey(K key, V filter(V val)) bool
Filter key with filter.
getStringKeyValue(String key) → V?
Returns a value by String key, treating all this instance keys as String.
getUnknownKeys(Iterable<K> knownKeys) List<K>
Returns all unknown keys, not present at knownKeys.
getValuesInKeysOrder(Iterable<K> keys) List<V>
Returns the values for keys (in the same order).
getValuesInStringKeysOrder(Iterable<String> keys) List<V>
Returns the values for keys (in the same order), using getStringKeyValue.
keepKeys(Iterable<K> keys) → void
Only keep keys, removing any key not in keys parameter.
keepKeysAndReturnValus(Iterable<K> keys) Map<K, V>
Only keep keys, removing any key not in keys parameter, than return a Map with them.
mergeKeysValues<M>(Map<K, V> other, M merger(K key, V val1, V val2), {V onAbsentKey(K key, bool other)?}) Map<K, M>
Merge this instance with other, calling merger for each key (of both Maps).
mergeKeysValuesNullable<M>(Map<K, V> other, M merger(K key, V? val1, V? val2)) Map<K, M>
Same as mergeKeysValues, but allows null at merger.
mergeKeysValuesToList(Map<K, V> other, {V onAbsentKey(K key, bool other)?}) Map<K, List<V>>
Merge this instance with other, merging keys values to a List<V>. See mergeKeysValues.
mergeKeysValuesToListNoNulls(Map<K, V> other) Map<K, List<V>>
Same as mergeKeysValuesToList, but ignore null values. See mergeKeysValues.
mergeKeysValuesToListNullable(Map<K, V> other) Map<K, List<V?>>
Same as mergeKeysValuesToList, but allows null values. See mergeKeysValues.
printElements({dynamic printer(Object? o)?, String prefix = '', String keyDelimiter = ': '}) → void
Prints this Map entries to printer, using keyDelimiter ("$key$keyDelimiter$value") to map each entry to String.
removeKeys(Iterable<K> keys) → void
Remove keys.
removeKeysAndReturnValues(Iterable<K> keys) Map<K, V>
Removes keys and return a Map with them.
renameKeys(Map<K, K> rename) → void
Rename the keys using the rename mapper.