title: flutter assign list values to a class
body: <p>Looking for help for assigning List values to a class.  Here is my class.</p>
  
  <pre><code>class Specialties {
    int id;
    String name;
    String details;
  
  
    const Specialties(this.id, this.name, this.details);
  
  }
  </code></pre>
  
  <p>I have a List created from JSON and I have confirmed it has values, but can not get the values assigned to instantiate the class.  I know the class works as when I hardcode values it gets created just fine.</p>
  
  <p>This is how I am trying to do it and can not find why it does not work.</p>
  
  <pre><code>Specialties getSpec(int index) {
      return new Specialties(mylist[index].id, mylist[index].name, mylist[index].details);
  
  }
  </code></pre>
  
  <p>I am sure I am missing something easy, but once I saw hardcoded values working, can not figure it out.</p>
  
  <p>Any help would be great.</p>