title: Flutter Cloud Firestore Map<String, dynamic> error
body: <p>I am trying to build an app using Flutter and Firestore. When loading a Collection from Firestore using StreamBuilder to display it in a ListView, I get the following error</p>
  
  <pre><code>The following assertion was thrown building StreamBuilder&lt;QuerySnapshot&gt;(dirty, state:
  I/flutter (26287): _StreamBuilderBaseState&lt;QuerySnapshot, AsyncSnapshot&lt;QuerySnapshot&gt;&gt;#d5638):
  
  I/flutter (26287): type '_InternalLinkedHashMap&lt;dynamic, dynamic&gt;' is not a subtype of type 'Map&lt;String, dynamic&gt;'
  
  I/flutter (26287): where
  
  I/flutter (26287):   _InternalLinkedHashMap is from dart:collection
  
  I/flutter (26287):   Map is from dart:core
  
  I/flutter (26287):   String is from dart:core
  </code></pre>
  
  <p>This is how I want to get data from the <code>DocumentSnapshot</code></p>
  
  <pre class="lang-dart prettyprint-override"><code>class Creator {
    const Creator({this.creatorId, this.name});
  
    Creator.fromDoc(DocumentSnapshot doc) : this.fromMap(doc.data);
  
    Creator.fromMap(Map&lt;String, dynamic&gt; map) :
      assert(map.containsKey('creatorId'),
      assert(map.containsKey('name'),
      this ( creatorId: map['creatorId'], name: map['name'] );
  
    /*
  
    ...
  
    */
  }
  </code></pre>
  
  <p>And how I want to use it</p>
  
  <pre class="lang-dart prettyprint-override"><code>return Scaffold(
    appBar: AppBar(title: new Text('Creators')),
    body: StreamBuilder&lt;QuerySnapshot&gt;(
      stream: CreatorRepo.getCreators().map&lt;List&lt;Creator&gt;&gt;((creators) {
        return creators.documents.map&lt;Creator&gt;((c) =&gt; Creator.fromSnapshot(c)).toList();
      }),
      builder: (BuildContext context, snapshot) {
        if ( snapshot.hasData ) {
          return ListView.builder(
            itemCount: snapshot.data.length,
            builder: (context, index) {
              final creator = snapshot.data[index];
  
              return ExpansionTile(
                title: Text(creator.name),
                children: [
                  Text(creator.creatorId),
                ],
              );
            },
          );
        }
  
        return const CircularProgressIndicator();
      },
    ),
  );
  </code></pre>
  
  <p>Dependencies:</p>
  
  <pre><code>dependencies:
    flutter:
      sdk: flutter
  
    cloud_firestore: ^0.6.3
    firebase_messaging: ^0.2.4
  </code></pre>
  
  <p>Firestore only allows for <code>String</code> keys and <code>dynamic</code> values being, with the exception of <code>Timestamp</code>, core language types. The <code>cloud_firestore</code> plugin keeps document data in an <code>_InternalLinkedHashMap&lt;dynamic, dynamic&gt;</code>. I thought that the <code>Map</code> inside all <code>DocumentSnapshot</code> would be <code>Map&lt;String, dynamic&gt;</code>. How can I work around this? Changing all functions to take <code>Map&lt;dynamic, dynamic&gt;</code> and assume the key is a <code>String</code> is a rather ugly workaround to the problem.</p>