title: Convert from Set to List in Dart / Flutter?
body: <p>I have a Set of type <code>Set&lt;WordPair&gt;</code> &amp; I want to convert it to List of type <code>List&lt;String&gt;</code> because I want to save it using <code>SharedPreferences</code> API in Flutter</p>
  
  <p>Currently, my state looks like</p>
  
  <pre><code>final Set&lt;WordPair&gt; _saved = Set&lt;WordPair&gt;();
  </code></pre>
  
  <p>Now I want to save the <code>_saved</code> variable into <code>SharedPreferences</code></p>
  
  <p>If I do, <code>prefs.setStringList('saved', _saved.toList());</code> it gives me compilation error like</p>
  
  <blockquote>
    <p>[dart] The argument type 'Set' can't be assigned to the parameter type 'List'. [argument_type_not_assignable]</p>
  </blockquote>
  
  <p>How do I store complete <code>_saved</code> variable in <code>SharedPreferences</code>?</p>