title: using FutureBuilder to get Future<String> from firestore
body: <p>This is my code in which I want to display an email which is a Future and I will get it from my firestore.However, I am not sure how I will need to retrieve my value using FutureBuilder which I want to use as a string.</p>
  
  <p>This is my method to get my email:</p>
  
  <pre><code>Future&lt;String&gt; getEmail() async {
      String _email = (await FirebaseAuth.instance.currentUser()).email;
      DocumentSnapshot snapshot = await _firestore.collection('users')
        .document(_email)
        .collection('met_with')
        .document('email')
        .get();
      // print("data: ${snapshot.data}"); // might be useful to check
      return snapshot.data['email']; // or another key, depending on how it's saved
    }
  </code></pre>
  
  <p>this is my updated code:</p>
  
  <pre><code>      @override
    Widget build(BuildContext context) {
      return Card(
        elevation: 3.0,
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
        child: ListTile(
          leading: CircleAvatar(
            backgroundImage: AssetImage(imagePath),
          ),
          trailing: Icon(Icons.more_horiz),
          title: Text(
            email,
            style: TextStyle(
              c  @override
    Widget build(BuildContext context) {
      return Card(
        elevation: 3.0,
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)),
        child: ListTile(
          leading: CircleAvatar(
            backgroundImage: AssetImage(imagePath),
          ),
          trailing: Icon(Icons.more_horiz),
          title: Text(
            email,
            style: TextStyle(
              color: Colors.deepPurple[700],
              fontWeight: FontWeight.bold,
            ),
          ),
          subtitle: Text(infection),
          onTap: () =&gt; showModalBottomSheet(
              context: context,
              builder: (builder) {
  
                return FutureBuilder(
                  future: getEmail(),
                  builder: (BuildContext context, snapshot) {
                  if(snapshot.hasData){
                    if(snapshot.connectionState == ConnectionState.waiting){
                      return Center(
                        child: CircularProgressIndicator(),
                      );
                    }else{
                      return Padding(padding: EdgeInsets.symmetric(vertical: 50.0, horizontal: 10.0),
                       child: Column(
                    children: &lt;Widget&gt;[
                      BottomSheetText(
                          question: 'Email', result:  snapshot.data['email']),
                      SizedBox(height: 5.0),
                      BottomSheetText(
                          question: 'Contact Time',result:"lol"),// getTimeStamp().toString()),
                      SizedBox(height: 5.0),
                      BottomSheetText(
                          question: 'Contact Location',
                          result: "help"),
                      SizedBox(height: 5.0),
                      BottomSheetText(question: 'Times Contacted', result: "lool",),
                    ],
                    ),
  
  
                       );
                    }
                  }else{
                    return CircularProgressIndicator();}
                  }
  
  
  
  
  
  
  
  
                       );
  
  
  
  
              }
          ),
  
  
  
  
  
                  ),
                );
  
  
  
    }
  }
  </code></pre>
  
  <p>Here is my firebase database:</p>
  
  <p><a href="https://i.stack.imgur.com/PngNq.png" rel="nofollow noreferrer">enter image description here</a></p>