title: Flutter FutureBuilder widget not responding to Future resolution when chaining Futures with await
body: <p>I am using a flutter widget's <code>initState()</code> method to create two future ints; <code>delayed</code> which is a simple <code>Future.delay</code>, and <code>delayedAwaited</code>, which awaits on the <code>delayed</code> variable and doubles its value. The <code>build()</code> method includes two <code>FutureBuilder</code>s, one for each future. See example code below:</p>
  <pre><code>class FutureTest extends StatefulWidget {
    @override
    _FutureTestState createState() =&gt; _FutureTestState();
  }
  
  class _FutureTestState extends State&lt;FutureTest&gt; {
    Future&lt;int&gt;? delayed;
    Future&lt;int&gt;? delayedAwaited;
  
    @override
    void initState() {
      super.initState();
      initFutures();
    }
  
    void initFutures() async {
      delayed = Future.delayed(Duration(seconds: 2), () =&gt; 5);
      delayedAwaited = Future.value((await delayed)! * 2);
    }
  
    @override
    Widget build(BuildContext context) {
      return Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          FutureBuilder(
            future: delayed,
            builder: (context, snapshot) =&gt; Text('delayed: ${snapshot.data}'),
          ),
          FutureBuilder(
            future: delayedAwaited,
            builder: (context, snapshot) =&gt; Text('awaited: ${snapshot.data}'),
          ),
        ],
      );
    }
  }
  </code></pre>
  <p>Here is the problem: The UI only updates for <code>delayed</code> and not <code>delayedAwaited</code> (it remains as null). The UI is updated to reflect the true value when manually hot-reloading, so the future is resolving correctly, but Flutter is just not triggering the <code>FutureBuilder</code> to rebuild. My expectation would be that the UI updates for <code>delayAwaited</code> as well.</p>
  <p>See the behavior here: <a href="https://dartpad.dev/62b272db200ca39ed854be5a7183967d?null_safety=true" rel="nofollow noreferrer">https://dartpad.dev/62b272db200ca39ed854be5a7183967d?null_safety=true</a></p>
  <p>For some reason, changing <code>initFutures()</code> so it uses <code>Future.delayed</code> for both futures fixes the issue, as shown here: <a href="https://dartpad.dev/9b386a45428046b193800351a4ade5b1?null_safety=true" rel="nofollow noreferrer">https://dartpad.dev/9b386a45428046b193800351a4ade5b1?null_safety=true</a></p>
  <p>Is anyone able to explain <strong>why</strong> the given code works like this, and what is best practice for achieving what I am trying to do.</p>