title: Flutter Future <String > cant be assigned to parameter type string
body: <p>I have a future which gives the a return leadid which is of type string.</p>
  
  <pre><code>Future&lt;String&gt; getleader() async {
      final DocumentSnapshot data = await Firestore.instance
          .collection('groups')
          .document(widget.detailDocument.data['groupId']).get();
      String leadid = data.data['leader'];
    return leadid;
    }
  </code></pre>
  
  <p>I want to use that value returend here.
       ListTile(
                          title: Text(getleader()),
                          leading: Text('Leader :'),
                        ),</p>
  
  <p>It says future string cant be assigned to parameter string.</p>
  
  <p>Also i have tried adding a a function to await result as follows</p>
  
  <pre><code> getdata2() async {
      String lead1= await getleader();
  </code></pre>
  
  <p>but it too shows the error Future dynamcic is not a subtype of type string</p>
  
  <p>This is where i want the to use the future value</p>
  
  <pre><code>  Widget _memebrprofile() {
      return FutureBuilder(
          future: getleader(),
          builder: (context, snapshot) {
            if (snapshot.hasData) {
              // store the value of the Future in your string variable
              storeValue = snapshot.data;
              return storeValue;
            }
            return Scaffold(
              drawer: newdrawer(),
              appBar: AppBar(
                title: Text('User Details'),
              ),
              body: SingleChildScrollView(
                child: ConstrainedBox(
                  constraints: BoxConstraints(),
                  child: Column(
                    children: &lt;Widget&gt;[
                      ListTile(
                        title: SelectableText(
                          widget.detailDocument.data["groupId"] ?? '',
                        ),
                        leading: Text('Group Id :'),
                      ),
                      ListTile(
                        title: Text(storeValue),//this is where i want to display the string
                        leading: Text('Leader :'),
                      ),
                      Row(
                        children: &lt;Widget&gt;[
                          Flexible(
                            child: RaisedButton(
                              onPressed: () {
               //this is where i want to use it as a string value to check a certain bool.                if (storeValue == _uid()) {
                                  Firestore.instance
                                      .collection('users')
                                      .document(widget.detailDocument.documentID)
                                      .updateData({
                                    'groupId': "",
                                  });
                                  Navigator.of(context).pop();
                                  Navigator.pushNamed(context, assignedTask.id);
                                } else {}
                              },
                              child: Text('Remove user'),
                            ),
                          ),
                          /* Flexible(
                            child:RaisedButton(
                              onPressed: () {
  
                              },
                              child: Text('Changerole to user'),
                            ),),
                            Flexible(
                              child: RaisedButton(
                                onPressed: () {
  
                                },
                                child: Text('Changerole to Admin'),
                              ),
                            ),*/
                          Flexible(
                            child: RaisedButton(
                              onPressed: () async {
                                FirebaseAuth auth = FirebaseAuth.instance;
                                final FirebaseUser user =
                                    await auth.currentUser();
                                final userid = user.uid;
                                if (widget.detailDocument.documentID == userid) {
                                  Navigator.pushNamed(context, MyProfile.id);
                                } else {}
                              },
                              child: Text('Edit Profile'),
                            ),
                          ),
                        ],
                      ),
                    ],
                  ),
                ),
              ),
            );
          });
    }
  }
  </code></pre>