title: Flutter: Builder calls twice in future builder when i throw exception
body: <p>I am trying to use snackbar on my future builder to shows error.So after making my future method instance on initState method:</p>
  
  <pre><code>Future&lt;DetailModel&gt; futureDetail;
    ...
     @override
    void initState() {
      futureDetail =
          DetailProvider().detailProvider(widget.id);
      super.initState();
    }
  </code></pre>
  
  <p>In futureBuilder i use like below:</p>
  
  <pre><code>Center(
                child: SingleChildScrollView(
                  child: FutureBuilder(
                    future: futureDetail,
                    builder:
                        (context, AsyncSnapshot&lt;DetailProductModel&gt; snapshot) {
                      if (!snapshot.hasError ||
                          snapshot.connectionState == ConnectionState.waiting) {
                        return Center(
                          child: CircularProgressIndicator(),
                        );
                      }
                      if (snapshot.hasData &amp;&amp; snapshot.data.data != null) {
                        return Container();
                      }
                      if (snapshot.hasError &amp;&amp;
                          snapshot.error != null &amp;&amp;
                          snapshot.data == null) {
                        WidgetsBinding.instance.addPostFrameCallback((_) =&gt;
                            showSnackbar(snapshot.error.toString(), context));
                        return Container();
                      } else {
                        return Center(
                          child: Text('failed to load'),
                        );
                      }
                    },
                  ),
                ),
              ),
  </code></pre>
  
  <p><code>detailProvider</code> method calls http service and in my example i throw  <code>SocketException</code> to get error on builder and show snackbar.</p>
  
  <blockquote>
    <p>I know future builder is for showing a widget per state but i want to
    show snakbar.</p>
  </blockquote>
  
  <p>But builder is called twice and snackbar shows twice an error?
  I checked that this three conditions are the same <code>snapshot.hasError and snapshot.error != null and snapshot.data == null</code> in twice build . How could i prevent showing twice snakbar?</p>