title: Getting "'context != null': is not true" error when trying to showDialogue after a MaterialPageRoute in Flutter?
body: <p>I am currently able to MaterialRoute to a page from the Home App in Flutter, as well as show a popup dialogue. However, upon routing from that second page to a third page, which contains a button that is supposed to show a dialogue, I am receiving this error: <code>[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: 'package:flutter/src/widgets/localizations.dart': Failed assertion: line 446 pos 12: 'context != null': is not true.
  </code></p>
  
  <p>The showDialogue that triggers that error looks like so:</p>
  
  <pre><code>
  class ThirdPageWidgetState extends State&lt;ThirdPageWidget&gt; {
  
    StreamSubscription&lt;ScanResult&gt; scanSubscription;
  
    @override
    void initState() {
      super.initState();
    }
  Future&lt;void&gt; alert(deviceName) async {
      return showDialog&lt;void&gt;(
        barrierDismissible: false, // user must tap button!
        builder: (BuildContext context) {
          return AlertDialog(
            title: Text('Button Pressed!'),
            content: SingleChildScrollView(
              child: ListBody(
                children: &lt;Widget&gt;[
                  Text('test'),
                ],
              ),
            ),
            actions: &lt;Widget&gt;[
              FlatButton(
                child: Text('Ok'),
              ),
            ],
          );
        },
      );
    }
  
    'Build function omitted'
  }
  </code></pre>
  
  <p>And the routing of the second page to the third page looks like this:</p>
  
  <pre><code>void routeAppToThirdPage() async {
      Navigator.push(
        context,
        MaterialPageRoute(
          builder: (context) =&gt; ThirdPageWidget(),
        ),
      );
    }
  </code></pre>