title: Best way to move to a new screen when future ends
body: <p>I have a splash screen that gets data from an api. I want this screen to be active (It contains a cirucular progress widget) while the data is being fetched, but as soon as it is fetched I must push a new route to go to next screen.</p>
  
  <p>I have been playing a bit with futurebuilder but this seems not to be the correct widget becasue I don't want to build anything (at least in this screen) when the data is fetched. I just want to keep it as a global state data and move forward.</p>
  
  <p>What's the best way to accomplish this in flutter?</p>
  
  <p>This is what I have right now:</p>
  
  <pre><code>class SplashScreen extends StatelessWidget {
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(
            title: Text("Guid Template test"),
          ),
          body: Container(
            child: Center(
                child: FutureBuilder(
                  future: getMenuConfiguration(),
                  builder: (builderContext, snapShot) {
                    //Here I would like to move to next screen, but this seems off because this is a builder method. Doesn't seem best option just a hack.
                    return Container();
                  },
  
                )
            ),
          ));
    }
  
    Future&lt;String&gt; getMenuConfiguration() async
    {
      String url = "https://...";
      http.Response response = await http.get(url);
  
      if (response.statusCode == 200) {
        var m = json.decode(response.body);
        MenuModel.fromJson(m);
      }
      else {
        throw Exception('Failed to load post');
      }
    }
  
  }
  </code></pre>