title: How can I delete duplicates in a Dart List? list.distinct()?
body: <p>How do I delete duplicates from a list without fooling around with a set? Is there something like list.distinct()? or list.unique()?</p>
  <pre><code>void main() {
    print(&quot;Hello, World!&quot;);
  
    List&lt;String&gt; list = ['abc',&quot;abc&quot;,'def'];
    list.forEach((f) =&gt; print(&quot;this is list $f&quot;));
  
    Set&lt;String&gt; set = new Set&lt;String&gt;.from(list);
    print(&quot;this is #0 ${list[0]}&quot;);
    set.forEach((f) =&gt; print(&quot;set: $f&quot;));
  
    List&lt;String&gt; l2= new List&lt;String&gt;.from(set);
    l2.forEach((f) =&gt; print(&quot;This is new $f&quot;));
  }
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>Hello, World!
  this is list abc
  this is list abc
  this is list def
  this is #0 abc
  set: abc
  set: def
  This is new abc
  This is new def
  </code></pre>
  <hr/>
  <p><strong>Set</strong> seems to be way faster!! But it loses the order of the items :/</p>