title: create list from DocumentSnapshot in flutter
body: <p>Ok, I am fairly new to flutter/Dart and I have learned a lot. However, I need help in understanding how to add data from a Firestore DocumentSnapshot to a list.</p>
  <p>I am trying to use the .addAll but I am sure I am using it wrong.</p>
  <pre><code>LinkedHashMap&lt;DateTime, List&lt;Event&gt;&gt; kEvents;
  
  List&lt;Event&gt; _getEventsForDay(DateTime day) {
      // kEvents is a linkedHashMap
      for (int i = 0; i &lt; eventDoc.length; i++ ) {
        DateTime eventDate = eventDoc[i].eventDate;
        DateTime eventDateUTC = eventDate.toUtc();
        if (day.year == eventDate.year &amp;&amp; day.day == eventDate.day &amp;&amp; day.month == eventDate.month) {
          List&lt;Event&gt; eventList;
          eventList.addAll(eventDoc[i]);
          return kEvents.putIfAbsent(eventDateUTC, () =&gt; eventList);
        }
      }
  }
  </code></pre>
  <p>This is the error I get:</p>
  <p>type 'Event' is not a subtype of type 'Iterable'
  See also: <a href="https://flutter.dev/docs/testing/errors" rel="nofollow noreferrer">https://flutter.dev/docs/testing/errors</a></p>
  <p>This is the Event class:</p>
  <pre><code>class Event {
    final String eventName;
    //final TimeOfDay eventStartTime;
    final DateTime eventStartTime;
    final String eventDuration;
    final DateTime eventDate;
    final String eventDescription;
    final String agentId;
    final String agencyId;
  
  
    Event(
        {this.eventName,
        this.eventStartTime,
        this.eventDuration,
        this.eventDate,
        this.eventDescription,
        this.agentId,
        this.agencyId});
  
    Map&lt;String, dynamic&gt; toMap() {
      return {
        'eventName': eventName,
        'eventStartTime': eventStartTime,
        'eventDuration': eventDuration,
        'eventDate': eventDate,
        'eventDescription': eventDescription,
        'agentId': agentId,
        'agencyId': agencyId,
      };
    }
  
    // pass in a map and get an object back
    Event.fromFirestore(Map&lt;String, dynamic&gt; firestore)
        : eventName = firestore['eventName'],
          eventStartTime = firestore['eventStartTime'].toDate(),
          eventDuration = firestore['eventDuration'],
          eventDate = firestore['eventDate'].toDate(),
          eventDescription = firestore['eventDescription'],
          agentId = firestore['agentId'],
          agencyId = firestore['agencyId'];
  }
  </code></pre>
  <p>This is a sample of the event record in Firestore:
  <a href="https://i.stack.imgur.com/zvAkt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zvAkt.png" alt="enter image description here" /></a></p>
  <p>Can someone please help me here with the .addAll method or show me a better way of doing this?</p>