title: How to get sub-collections of every collection in Firestore using Flutter
body: <p>I'm building a task management app where every user has multiple projects (collections), inside every project there are tasks (collections), and inside every task there are sub-tasks.</p>
  <p>I was able to retrieve all the projects using this code:</p>
  <pre><code>User user = Provider.of&lt;User&gt;(context);
  CollectionReference projects = Firestore.instance.collection('users').document(user.uid).collection(&quot;projects&quot;);
  </code></pre>
  <p>But my question is how can I get all the tasks and sub-tasks (if they exist) from every project and list them in a StreamBuilder?</p>
  <p>Here's my current code:</p>
  <pre><code>Flexible(
              child: StreamBuilder&lt;QuerySnapshot&gt;(
                stream: projects.snapshots(),
                builder: (BuildContext context,
                    AsyncSnapshot&lt;QuerySnapshot&gt; snapshot) {
                  if (snapshot.hasError) {
                    return Text('Something went wrong');
                  }
  
                  if (snapshot.connectionState == ConnectionState.waiting) {
                    return Text(&quot;Loading&quot;);
                  }
  
                  return new ListView(
                    children:
                        snapshot.data.documents.map((DocumentSnapshot document) {
                      return new ListTile(
                        title: new Text(document.data['project_name']),
                        subtitle: new Text(document.data['project_description']),
                      );
                    }).toList(),
                  );
                },
              ),
            ),
  </code></pre>
  <p>If the project has tasks I want to display them below the project description, and if the task has sub-tasks I want to show them below its parent task.</p>