title: Flutter how to use Future return value as if variable
body: <p>I want to get <code>Future</code> return value and use it like variable.
  I have this <code>Future</code> function</p>
  
  <pre><code>  Future&lt;User&gt; _fetchUserInfo(String id) async {
      User fetchedUser;
      await Firestore.instance
          .collection('user')
          .document(id)
          .get()
          .then((snapshot) {
        final User user = User(snapshot);
        fetchedUser = user;
      });
      return fetchedUser;
    }
  </code></pre>
  
  <p>And I want get value like so</p>
  
  <pre><code>final user = _fetchUserInfo(id);
  </code></pre>
  
  <p>However when I tried to use like this</p>
  
  <pre><code>new Text(user.userName);
  </code></pre>
  
  <p>Dart doesn't recognize as <code>User</code> class. It says <code>dynamic</code>.<br>
  How Can I get return value and use it?<br>
  Am I doing wrong way first of all?
  Any help is appreciated! </p>