title: Dart sort List of Maps based on list of values
body: <p>I have a list of maps, and i want to sort it based on values that are in another list, here is the data list:</p>
  <pre><code>final data = [{
    'id' : 1,
  },
  {
    'id' : 10,
  },
     
  {
    'id' : 2,
  },
     
     {
    'id' : 1,
  },
     {
    'id' : 10,
  },
     {
    'id' : 1000,
  }];
  </code></pre>
  <p>And this is the sorting list:</p>
  <pre><code>List&lt;int&gt;  sortingList =  [1000,1, 6, 99];
  </code></pre>
  <p>I want to sort the <code>data</code> list based on the order of the ids that exists in the <code>sortingList</code>, meaning for example <code>1000</code> is in position one so i want the data that has <code>id == 1000</code> at the beginning of the list, <code>1</code> is the second element of the <code>sortingList</code> so i want all the data that has <code>id == 1</code> to be listed after the elements that has <code>1000</code> and so on. The elements that has <code>id</code> that's not in <code>sortingList</code> should be at the end of the list, the final result if i print the value <code>id</code> after sorting it should be like this:</p>
  <pre><code>for (var i = 0; i &lt; data.length; i++) {
        print(data[i][&quot;id&quot;]);
  }
  
   1000
   1
   1
   10
   2
   10
  </code></pre>