title: how to get data from firebase in flutter
body: <p>I am building a flutter app and using cloud-firestore,
  this is how my database looks like
  <a href="https://i.stack.imgur.com/CPJu5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CPJu5.png" alt="enter image description here" /></a></p>
  <p>I want a function that retrieves all documents in the collection called &quot;Driver List&quot; in an array of strings
  that what I had already used but it gets them back in a listview in a new screen</p>
  <pre><code>class DriverList extends StatelessWidget {@overrideWidget build(BuildContext context) {
      return new StreamBuilder&lt;QuerySnapshot&gt;(
        stream: Firestore.instance.collection('DriverList').snapshots(),
        builder: (BuildContext context, AsyncSnapshot&lt;QuerySnapshot&gt; snapshot) {
          if (!snapshot.hasData) return new Text('Loading...');
          return new ListView(
            children: snapshot.data.documents.map((DocumentSnapshot document) {
              return new ListTile(
                title: new Text(document['name']),
                subtitle: new Text(document['phone']),
              );
           }).toList(),
         );
       },
     );
   }
  }
  </code></pre>