title: Firebase snapshot.data.documents with flutter: what exactly am I doing here?
body: <p>I would like to understand better how firebase works?</p>
  
  <p>Let's say I have a firestore database and there is a collection ("books") and I have several documents containing different info like title, authors, url of the book image, publication date, etc. I want to present the information in a list. Here is my code</p>
  
  <pre><code>class BookList extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return StreamBuilder&lt;QuerySnapshot&gt;(
        stream: _firestore
            .collection('books')
            .snapshots(),
        builder: (context, snapshot) {
              final booksDB = snapshot.data.documents;
              List&lt;Book&gt; books = [];
              for (var rest in booksDB) {
                final restName = rest.data['name'];
                final restURL = rest.data['url'];
  
                  final book = Book(
                    name: restName,
                    url: restURL,
                  );
                  books.add(book);
              }
  
              return ListView(
                children: books,
              );
          }
        },
      );
    }
  }
  
  class Book extends StatelessWidget {
    Book({this.name, this.url});
  
    final String name;
    final String url;
  
    @override
    Widget build(BuildContext context) {
      return Stack(
        children: &lt;Widget&gt;[
          Container(
            margin: EdgeInsets.all(10.0),
              child: new CachedNetworkImage(
                  imageUrl: url != null
                      ? url
                      : 'https://webhostingmedia.net/wp-content/uploads/2018/01/http-error-404-not-found.png',
                  placeholder: (context, url) =&gt; new CircularProgressIndicator(),
                  errorWidget: (context, url, error) =&gt; new Icon(Icons.error),
                  width: MediaQuery.of(context).size.width - 20,
                  height: (MediaQuery.of(context).size.width - 20) / 3 * 2,
                  fit: BoxFit.cover),
  
          ),
          Positioned(
              bottom: 20.0,
              left: 20.0,
              child: Text(name,
                  style: kSendButtonTextStyle.copyWith(
                    backgroundColor: kColorPrimary.withOpacity(0.5),
                  ))),
        ],
      );
    }
  }
  </code></pre>
  
  <p>Here is my question: what am I exactly doing when I am writing <code>final booksDB = snapshot.data.documents;</code>?
  Am I downloading all the documents and all the related fields? Or am I just creating a reference? I would like to know if I am downloading all the info or just the one I am adding to the books list (name and url)</p>
  
  <p>This is important to me because I would like to control my firebase reads and I do not need to read something if I am not using it...</p>
  
  <p>I hope the question is clear. thanks </p>