title: flutter Sorting arraylist by Date
body: <p>In My streamBuilder I have Array list contains dates having format(dd-MM-yyyy).
  I want to arrange the list in ascending order.
  <strong>The code I used in StreamBuilder after getting Datasnapshot</strong></p>
  <pre><code> Map&lt;dynamic, dynamic&gt; data = snap.data.snapshot.value;
  
                List item = [];
                data.forEach(
                    (index, data) =&gt; item.add(
                        {&quot;key&quot;: index, ...data}
                        )
                );
                item..sort((a,b)=&gt;a['key'].compareTo(b['key']));
  </code></pre>
  <p><strong>I am expecting result as</strong>
  16-06-2020
  17-06-2020
  18-06-2020
  19-06-2020
  22-06-2020
  04-07-2020</p>
  <p><strong>The result I am getting is</strong>
  04-07-2020
  16-06-2020
  17-06-2020
  18-06-2020
  19-06-2020
  22-06-2020</p>