Closed
Description
This issue was originally filed by @seaneagan
Map should have something like:
/// a live view of the [:Pair:]s contained in this Map
Set<Pair<K, V>> get pairs;
...and a corresponding constructor:
Map.fromPairs(Iterable<Pair<K, V>> pairs);
where Pair is just:
class Pair<K, V> {
const Pair(this.key, this.value);
final K key;
final V value;
}
Examples:
print(map.pairs.mappedBy((pair) => "${pair.key} -> ${pair.value}").join(", "));
var nonNullMap = new Map.fromPairs(map.pairs.where((pair) => pair.value != null));