title: Flutter Sort array by other array values
body: <p>I have data like this</p>
  <pre><code>[{&quot;name&quot;: &quot;swimming&quot;},{&quot;name&quot;: &quot;Politics&quot;},{&quot;name&quot;: &quot;Gamer&quot;}]
  </code></pre>
  <p>and I have profiles like</p>
  <pre><code>[
     {
        &quot;username&quot;:&quot;abc&quot;,
        &quot;passions&quot;:[
           {
              &quot;name&quot;:&quot;Snooker&quot;
           }
        ]
     },
     {
        &quot;username&quot;:&quot;abc&quot;,
        &quot;passions&quot;:[
           {
              &quot;name&quot;:&quot;Coding&quot;
           }
        ]
     },
     {
        &quot;username&quot;:&quot;xyz&quot;,
        &quot;passions&quot;:[
           {
              &quot;name&quot;:&quot;swimming&quot;
           }
        ]
     },
     {
        &quot;username&quot;:&quot;abc&quot;,
        &quot;passions&quot;:[
           {
              &quot;name&quot;:&quot;Politics&quot;
           },
           {
              &quot;name&quot;:&quot;swimming&quot;
           }
        ]
     }
  ]
  </code></pre>
  <p>What I need to do is show first those profiles whose passions are matching with that first data array and then the other rest remaining will show.</p>