title: Listview group by date Dart
body: <p>I've been trying to get some messages ordered by date, but I'm not getting it working. I have tried different packages like <a href="https://pub.dev/packages/grouped_list" rel="noreferrer">grouped_list</a> and <a href="https://pub.dev/packages/sticky_headers" rel="noreferrer">sticky_headers</a>.</p>
  <p>With <a href="https://pub.dev/packages/sticky_headers" rel="noreferrer">sticky_headers</a> I managed to get a header above every post but that's not what I want. I want to have the messages sorted by day. Like the image below:
  <br>
  <a href="https://i.stack.imgur.com/CCeke.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/CCeke.jpg" alt="Application example" /></a></p>
  <p>Below I have an dataset with de data I get from my API. My intention is to get 40 messages from the API. Those 40 messages are sorted by time only the messages must be grouped by day in the app as the image above.</p>
  <p>Edit:
  After some playing with <a href="https://pub.dev/packages/sticky_headers" rel="noreferrer">sticky_header</a> package on flutter. I have now managed to get the headers. Only do not manage to get the messages under the correct header.</p>
  <p>Dataset:</p>
  <pre><code>[
    {
      &quot;time&quot;: &quot;2020-06-16T10:31:12.000Z&quot;,
      &quot;message&quot;: &quot;P2 BGM-01 HV buiten materieel (Gas lekkage) Franckstraat Arnhem 073631&quot;
    },
    {
      &quot;time&quot;: &quot;2020-06-16T10:29:35.000Z&quot;,
      &quot;message&quot;: &quot;A1 Brahmslaan 3862TD Nijkerk 73278&quot;
    },
    {
      &quot;time&quot;: &quot;2020-06-16T10:29:35.000Z&quot;,
      &quot;message&quot;: &quot;A2 NS Station Rheden Dr. Langemijerweg 6991EV Rheden 73286&quot;
    },
    {
      &quot;time&quot;: &quot;2020-06-15T09:41:18.000Z&quot;,
      &quot;message&quot;: &quot;A2 VWS Utrechtseweg 6871DR Renkum 74636&quot;
    },
    {
      &quot;time&quot;: &quot;2020-06-14T09:40:58.000Z&quot;,
      &quot;message&quot;: &quot;B2 5623EJ : Michelangelolaan Eindhoven Obj: ziekenhuizen 8610 Ca CATH route 522 PAAZ Rit: 66570&quot;
    }
  ]
  </code></pre>