title: Dealing with Future<String> Inside of a Widget
body: <p>I'm trying to make my app display the results of a HTTP request as a button. Here is the function that makes the request.</p>
  <pre><code>Future&lt;String&gt; client() async {
    return await HttpRequest.getString('localhost:8000');
  }
  </code></pre>
  <p>Here is the button I'd like to display it in.</p>
  <pre><code>ElevatedButton(
    onPressed: () {},
    child: Text('This is a Deck'),
  ),
  </code></pre>
  <p>I'd like to display the request in place of the string 'This is a Deck'. I've tried <code>await client()</code> and <code>client().toString()</code> but these did not work. Here is my full widget class if that helps.</p>
  <pre><code>class DeckButtons extends StatelessWidget {
    DeckButtons({Key key}) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return Center(
        child: Row(
          mainAxisSize: MainAxisSize.min,
          children: &lt;Widget&gt;[
            ElevatedButton(
              onPressed: () {},
              child: Text('This is a Deck'),
            ),
            IconButton(
              icon: Icon(Icons.add),
              onPressed: () {},
              tooltip: 'Add a Card',
            ),
            IconButton(
              icon: Icon(Icons.search),
              onPressed: () {},
              tooltip: 'See All Cards',
            ),
            IconButton(
              icon: Icon(Icons.delete),
              onPressed: () {},
              tooltip: 'Delete this Deck',
            )
          ],
        ),
      );
    }
  }
  </code></pre>
  <p>I'm brand new to Flutter and Asynchronous programming so my apologies if the answer to this question is obvious.</p>
  <p><sup>Edit: I've been told that my question is a duplicate of <a href="https://stackoverflow.com/questions/63017280">&quot;What is a Future and how do I use it?&quot;</a>. I don't think that my question is a duplicate because although some parts of the answer may apply to my situation, the question and the accepted answer are much too broad and cover a lot of additional information. Additionally, I still have not implemented a fix for my problem and I am unsure that the answer given in that post is of any help to me</sup></p>