title: Flutter - how to get current context?
body: <p>I am using Firebase cloud messaging for notifications, and i want to show a dialog or snackbar once i receive a notification when i am inside the application, my problem is that i am initializing the firebase configuration at the top of my widget tree (Splash screen once the app is starting) </p>
  
  <pre><code>_fireBaseMessaging.configure(
    onMessage: (Map&lt;String, dynamic&gt; message) async {
      dynamic data = message['data'];
      ................ // Adding a snackbar/alertdialog here doesn't work
    },
  );
  </code></pre>
  
  <p>obviously if i set a dialog or snackbar it won't show since i need the context of my current page, is there any way to get the current context?</p>
  
  <p>I also tried putting it inside the build widget of my splash screen but still the dialog isn't showing once i am on another page.</p>
  
  <pre><code> @override
    Widget build(BuildContext context) {
      _fireBaseMessaging.configure(
        onMessage: (Map&lt;String, dynamic&gt; message) async {
          print("onMessage: $message");
          dynamic data = message['data'];
          if (data['id'] == '1') {
            newPro = true;
          } else if (data['id'] == '2') {
            print("THIS WORKS!!!");
            showDialog(
                context: context,
                builder: (context) =&gt; AlertDialog(
                      content: ListTile(
                        title: Text("TEST"),
                        subtitle: Text("TEST"),
                      ),
                      actions: &lt;Widget&gt;[
                        FlatButton(
                          child: Text("OK"),
                          onPressed: () =&gt; Navigator.pop(context),
                        )
                      ],
                    ));
          }
        },
      );
  </code></pre>