LinkedHashMap.fromIterables factory constructor

LinkedHashMap.fromIterables(Iterable<K> keys, Iterable<V> values)

Creates a LinkedHashMap associating the given keys to values.

This constructor iterates over keys and values and maps each element of keys to the corresponding element of values.

If keys contains the same object multiple times, the last occurrence overwrites the previous value.

It is an error if the two Iterables don't have the same length.

Source

factory LinkedHashMap.fromIterables(Iterable<K> keys, Iterable<V> values) {
  LinkedHashMap<K, V> map = new LinkedHashMap<K, V>();
  Maps._fillMapWithIterables(map, keys, values);
  return map;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-collection/LinkedHashMap/LinkedHashMap.fromIterables.html