title: Dart: filter lists with maps
body: <p>LIST 1: I have a list with user ids: (selected users)</p>
  
  <pre><code>['1234', '3455', '2330', '1111']
  </code></pre>
  
  <p>LIST 2: I have a second list with the full profile of the users (map): (all users)</p>
  
  <pre><code>[{"id": '1234', "name": "username"}, {"id": '3455' .... ]
  </code></pre>
  
  <p>LIST 3: I would like to have a third list that contains all selected users: returning all users of LIST 2 that have an id of LIST 1.</p>
  
  <p>I tried this...</p>
  
  <pre><code> list1.forEach((element) =&gt;
           list3.add(list2.where((data) =&gt; data['id'] == element)));
  </code></pre>
  
  <p>But that doesn't work... </p>
  
  <pre><code>error: The argument type 'Iterable&lt;Map&lt;String, dynamic&gt;&gt;' can't be assigned to the parameter type 'Map&lt;String, dynamic&gt;'. 
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Thanks in advance!</p>