title: How to order a list of maps in dart
body: <p>I'm supposed to order a list of maps and I've tried everything I can think of, no breakthrough.</p>
  <p>Here's my code:</p>
  <pre><code>var orgs = [
    {&quot;name&quot;: &quot;Google&quot;, &quot;category&quot;: &quot;Search Engine&quot;},
    {&quot;name&quot;: &quot;Facebook&quot;, &quot;category&quot;: &quot;Social Media&quot;},
    {&quot;name&quot;: &quot;Adidas&quot;, &quot;category&quot;: &quot;Sports&quot;}
  ];
  </code></pre>
  <p>I want to sort this list by name. I tried using this code:</p>
  <pre><code>  orgs.sort((i, j) =&gt; i.name.compareTo(j.name)); //I get an error that name is not defined. only works with classes
  </code></pre>
  <p>But I get an error that name is not defined. What am I doing wrong? Or is there another approach i can try? Please assist</p>
  <p>By the way, its important that orgs is strictly a list, not anything else!</p>