title: Error: Class 'QuerySnapshot' has no instance getter 'data'
body: <p>I'm trying to creat a UI screen with 3 tabs in it. RecentItem, ReviewItem and Profile. however there's some backend problem in recentitem widget. With the error shown: Class 'QuerySnapshot' has no instance getter 'data'.
  Ps: The whole code is quite big hence I have shared a doc for the whole code: <a href="https://docs.google.com/document/d/1qs4ajPJ0DBjserBJ3iBZmPXPz1zTP7tIYSh8vceVQn8/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/document/d/1qs4ajPJ0DBjserBJ3iBZmPXPz1zTP7tIYSh8vceVQn8/edit?usp=sharing</a>
  RecentItems():</p>
  
  <pre><code>Widget RecentItems() {
      return Padding(
        padding: const EdgeInsets.all(10.0),
        child: StreamBuilder(
            stream: Firestore.instance
                .collection("users")
                .document(uid)
                .collection("recent")
                .snapshots(),
            builder: (context, snapshot) {
              print(snapshot.data);
              List orders = List.from(Map.from(snapshot.data.data)['orders']);
              Map order;
              for (int i = 0; i &lt; orders.length; i++) {
                if (orders[i]['orderId'] == widget.map['orderId'] &amp;&amp;
                    orders[i]['homemaker'] == widget.map['homemaker']) {
                  order = orders[i];
                  break;
                }
              }
              if (snapshot.data.isEmpty) {
                return Center(
                    child:
                    Text("OOPS, Looks like no one is serving!"));
              }
              print(order);
              if (snapshot.connectionState == ConnectionState.waiting) {
                return Center(child: CircularProgressIndicator());
              } else if (snapshot.hasData) {
                print(snapshot.data.documents[0].data);
                return Container(
                  height: 400,
                  child: ListView.builder(
                      itemCount: snapshot.data.documents.length,
                      itemBuilder: (BuildContext context, int index) {
                        return Container(
                          margin: EdgeInsets.all(10.0),
                          width: MediaQuery
                              .of(context)
                              .size
                              .width,
                          height: 85,
                          decoration: BoxDecoration(
                            color: Colors.white,
                            borderRadius: BorderRadius.circular(10.0),),
                          child: Padding(
                            padding: const EdgeInsets.all(10.0),
                            child: Column(
                              mainAxisAlignment: MainAxisAlignment.start,
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: &lt;Widget&gt;[
                                Row(
                                  children: &lt;Widget&gt;[
                                    Expanded(child: Text(
                                      "${snapshot.data.documents[index]
                                          .data["dishname"]}", style: TextStyle(
                                        fontSize: 15,
                                        fontWeight: FontWeight.bold),)),
                                    //Icon: how to access if food is veg or not
                                  ],
                                ),
                                // SizedBox(height:5),
                                Row(
                                  children: &lt;Widget&gt;[
                                    Expanded(child: Text(
                                      "${snapshot.data.documents[index]
                                          .data["homemaker"]}",
                                      style: TextStyle(fontSize: 10),)),
                                    Text("${snapshot.data.documents[index]
                                        .data["rating"]}",
                                        style: TextStyle(fontSize: 15)),
                                    Icon(
                                      Icons.star, color: Colors.yellow.shade800,
                                      size: 20,)
                                  ],
                                ),
                                SizedBox(height: 5),
                                //How to access order date
                                Text(
                                  "Ordered ${DateTime
                                      .parse(order['order_placed_at']
                                      .toDate()
                                      .toString())
                                      .day}/${DateTime
                                      .parse(order['order_placed_at']
                                      .toDate()
                                      .toString())
                                      .month}/${DateTime
                                      .parse(order['order_placed_at']
                                      .toDate()
                                      .toString())
                                      .year}}",
                                  style: TextStyle(fontSize: 15.0,
                                      fontWeight: FontWeight.bold),
                                ),
                              ],
                            ),
                          ),
                        );
                      }),
                );
              } //
            }),
      );
    }
  </code></pre>
  
  <p>The Error Message is:</p>
  
  <pre><code>The getter 'data' was called on null.
  Receiver: null
  Tried calling: data
  The relevant error-causing widget was: 
    StreamBuilder&lt;QuerySnapshot&gt; file:///C:/Flutter/Naniz_eats/lib/UserProfilePage.dart:434:14
  ════════════════════════════════════════════════════════════════════════════════════════════════════
  I/flutter (28940): Instance of 'QuerySnapshot'
  
  ════════ (3) Exception caught by widgets library ═══════════════════════════════════════════════════
  Class 'QuerySnapshot' has no instance getter 'data'.
  Receiver: Instance of 'QuerySnapshot'
  Tried calling: data
  The relevant error-causing widget was: 
    StreamBuilder&lt;QuerySnapshot&gt; file:///C:/Flutter/Naniz_eats/lib/UserProfilePage.dart:434:14
  </code></pre>