Map<K,V>.fromIterables constructor
Creates a map associating the givenkeys to the givenvalues.
The map construction iterates overkeys andvalues simultaneously,and adds an entry to the map for each pair of key and value.
final rings = <bool>[false, false, true, true];final planets = <String>{'Earth', 'Mars', 'Jupiter', 'Saturn'};final map = Map<String, bool>.fromIterables(planets, rings);print(map); // {Earth: false, Mars: false, Jupiter: true, Saturn: true}Ifkeys contains the same object multiple times,the value of the last occurrence overwrites any previous value.
The twoIterables must have the same length.
The created map is aLinkedHashMap.ALinkedHashMap requires the keys to implement compatibleoperator== andhashCode.It iterates in key insertion order.
Implementation
factory Map.fromIterables(Iterable<K> keys, Iterable<V> values) = LinkedHashMap<K, V>.fromIterables;