title: How to convert a List into a Map in Dart
body: <p>I looking for an <strong>on-the-shelf</strong> way to convert a List into a Map in Dart.</p>
  
  <p>In python for example you can do:</p>
  
  <pre><code>l= [ ('a',(1,2)), ('b',(2,3)), ('c',(3,4) ) ]
  d=dict(l)
  ==&gt; {'a': (1, 2), 'c': (3, 4), 'b': (2, 3)}
  </code></pre>
  
  <p>The dict function expects a List of couple. For each couple, the first element is used as the key and the second as the data.</p>
  
  <p>In Dart I saw the following method for a List : <strong>asMap()</strong>, but it's not doing what i expect: it use the list index as key. 
  My questions:</p>
  
  <ul>
  <li>Do you known anything in Dart libraries to do this ?  </li>
  <li>If not, any plan to add such a feature in the core lib ?</li>
  </ul>
  
  <p>Proposal:</p>
  
  <pre><code>List.toMap() //same as python dict.
  List.toMap( (value) =&gt; [ value[0], value[1] ] ) //Using anonymous function to return a key and a value from a list item.
  </code></pre>
  
  <p>Thanks and Regards,</p>
  
  <p>Nicolas</p>