title: Update FutureBuilder on button pressed
body: <p>I want to display an object retrived calling an <code>api</code> on button pressed.</p>
  
  <p>I want to update <code>FutureBuilder</code> widget when I press the <code>floatingActionButton</code>:</p>
  
  <pre><code>    class PostScreen extends StatefulWidget {
        const PostScreen();
  
        @override
        State&lt;StatefulWidget&gt; createState() =&gt; _PostScreenState();
      }
  
      class _PostScreenState extends State&lt;PostScreen&gt; {
      Future&lt;Post&gt; _post;
      PostApi _postApi;
  
      @override
        void initState() {
          super.initState();    
         _postApi = Provider.of&lt;PostApi&gt;(context, listen: false);
        }
  
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            floatingActionButton: FloatingActionButton(onPressed: () {       
              setState((){
               _post = _postApi.fetchPost();          
            }); }), 
            appBar: AppBar(title: const Text('Post')),
            body:     
          FutureBuilder&lt;Post&gt;(
              future: _post,
              builder: (BuildContext context, AsyncSnapshot&lt;Post&gt; snapshot)   {
                return snapshot.connectionState == ConnectionState.done
                    ? snapshot.hasData
                        ? _buildRoot(snapshot.data)
                        :  Text(snapshot.error.toString());
                    : const Text('...');
              }),
              ) ;
        }
  </code></pre>
  
  <pre><code>class Post {
    Post.fromJson(this.data);
    dynamic data;  
  }
  </code></pre>
  
  <pre><code>class PostApi{
     PostApi(this._httpManager);  
   final HttpManager _httpManager;
  
    Future&lt;Post&gt; fetchPost() async {
      final http.Response response =
        await _httpManager.get('https://jsonplaceholder.typicode.com/posts/1');
  
    if (response.statusCode == 200) {
      return Post.fromJson(json.decode(response.body)); 
    } else {   
       throw Exception('Failed to load post'); 
    } 
  }
  </code></pre>
  
  <p>Everythings work but I have an issue when in the <code>fetchPost</code> method there is an exception. For example:</p>
  
  <pre><code>  Future&lt;Post&gt; fetchPost() async {
      final http.Response response =
        await _httpManager.get('https://jsonplaceholder.typicode.com/posts/1');
  
    throw Exception('Failed to load post');  
    }
  }
  </code></pre>
  
  <p>In this case the <code>futureBuilder</code> connectionState is in <strong>waiting</strong> status instead of <strong>done</strong>.</p>
  
  <p>What I'm doing wrong?</p>