title: How do I display text from firestore data in flutter?
body: <p>I am new to firebase/firestore and wanted to add firestore to my app. My app currently has a login and adds data to the database with the UID set as the document name. <a href="https://i.stack.imgur.com/0CRnT.png" rel="nofollow noreferrer">Console Image</a>
  I want to display the name in my apps profile page. How would I achieve this?</p>
  
  <p>Called it with this</p>
  
  <pre><code>Center(child:building(context),),
  </code></pre>
  
  <pre><code>  Widget building(BuildContext context) {
      return new StreamBuilder(
          stream: Firestore.instance
              .collection('UserData')
              .document(getUID())
              .snapshots(),
          builder: (context, snapshot) {
            if (!snapshot.hasData) {
              return new Text("Loading");
            } else {
              return new Text(snapshot.data.toString());
            }
          });
    }
  </code></pre>
  
  <p>Current Error
  <a href="https://i.stack.imgur.com/KbOz0.png" rel="nofollow noreferrer">Error Image</a></p>
  
  <p>Previous Error</p>
  
  <p><a href="https://i.stack.imgur.com/mC1Ky.png" rel="nofollow noreferrer">Error Message</a></p>
  
  <p>Thanks in advance!</p>