title: Flutter get_it and FutureBuilder not working with hot reload
body: <p>The app below works as expected, but unfortunately it does not work with hot reload. I would like to know how to get hot reload working with it.</p>
  
  <p>All the code does is simply to wait for a particular <code>Future&lt;String&gt;</code> to be available, and then to display that string on screen. While it's waiting, a progress indicator is displayed.</p>
  
  <p>As I said, that works as expected, but the problem is that if I change anything (I mean just simple cosmetic stuff) and hot reload kicks in, the app will just sit there forever showing the progress indicator because the <code>connectionState</code> stays in <code>ConnectionState.waiting</code> mode.</p>
  
  <p>This is what the code does in more detail:</p>
  
  <p>I register a <code>String</code> object as a singleton in <code>GetIt</code>. Since that string is wrapped in a <code>Future</code>, the code has to wait for it to be ready before it can be registered.</p>
  
  <p>(In the real code, I am loading a JSON string from an asset. That's why it's in a <code>Future</code>.) </p>
  
  <p>A <code>FutureBuilder</code> waits for the string singleton to be available by waiting for <code>GetIt</code> to signal a property called <code>readyFuture</code>.</p>
  
  <p>When the string becomes available, the <code>FutureBuilder</code> displays it on screen. Until then, a <code>CircularProgressIndicator</code> is displayed.</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:get_it/get_it.dart';
  
  GetIt locator = GetIt.instance;
  
  void setupLocator() async {
    final str = await Future&lt;String&gt;.delayed(Duration(seconds: 3), () =&gt; "hello");
    locator.registerSingleton(str, signalsReady: true);
    locator.signalReady(str);
  }
  
  void main() {
    setupLocator();
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: MyHomePage(),
      );
    }
  }
  
  class MyHomePage extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: FutureBuilder&lt;void&gt;(
          future: locator.readyFuture,
          builder: (BuildContext context, AsyncSnapshot&lt;void&gt; snapshot) {
            Widget result;
  
            switch (snapshot.connectionState) {
              case ConnectionState.none:
              case ConnectionState.active:
              case ConnectionState.waiting:
                result = Center(child: CircularProgressIndicator());
                break;
              case ConnectionState.done:
                if (snapshot.hasError)
                  result = Center(child: Text('Error: ${snapshot.error}'));
                else
                  result = Center(child: Text('${locator.get&lt;String&gt;()}'));
                break;
            }
  
            return result;
          }
        ),
      );
    }
  }
  </code></pre>
  
  <p>I have these dependencies in my pubspec.yaml:</p>
  
  <pre><code>  get_it: ^3.0.1
    provider: ^3.1.0
  </code></pre>