title: How do i retrieve a List<Map<String,Object>> from cloud firestore and convert it into a custom model?
body: <p>The structure of my data looks like this:
  <a href="https://i.stack.imgur.com/g2Voe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g2Voe.png" alt="enter image description here" /></a></p>
  <p>I want to retrieve this data which I have done using this where studentReference is CollectionReference to students collection.
  <a href="https://i.stack.imgur.com/CcwnV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CcwnV.png" alt="enter image description here" /></a></p>
  <p>This returns me this
  <a href="https://i.stack.imgur.com/d8Fv6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d8Fv6.png" alt="enter image description here" /></a></p>
  <p>Now I want to map this data into a Custom Subject class that looks like this</p>
  <pre><code>class Subjects {
    int totalAttended;
    int attended;
    int missed;
    final String subjectName;
    final String subjectId;
    final String subjectTeacher;
  
    Subjects(
        {this.attended,
        this.missed,
        this.totalAttended = 0,
        this.subjectId,
        this.subjectName,
        this.subjectTeacher});
  }
  </code></pre>
  <p>But can't figure out how to do this mapping. I know I need to use stream but don't know how.</p>
  <p>Any help would be immensely appreciated.</p>