title: Looking up a deactivated widget's ancestor is unsafe
body: <p>I am new in Flutter and I am trying receive data with a Dialog.
  When a click in textField the error of image2 appear...</p>
  
  <p><img src="https://i.stack.imgur.com/kWit6.png" alt="Layout&#39;s Image">
  <img src="https://i.stack.imgur.com/Wlmmy.png" alt="Error&#39;s Image"></p>
  
  <pre><code>show(BuildContext context){
  
      var dialog = Dialog(
        child: Container(
          margin: EdgeInsets.all(8.0),
          child: Form(
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: &lt;Widget&gt;[
                TextFormField(
                  decoration: InputDecoration(
                      labelText: "Insira o número de telefone",
                      border: OutlineInputBorder(
                          borderRadius: BorderRadius.all(Radius.circular(2.0)))),
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: &lt;Widget&gt;[
                    FlatButton(
                        onPressed: () {
                          Navigator.of(context).pop();
                        },
                        child: Text("Cancelar")),
                    FlatButton(
                        onPressed: () {
                          Navigator.of(context).pop();
                        },
                        child: Text("Aceitar"))
                  ],
                )
              ],
            ),
          ),
        ),
      );
  
      showDialog(context: context,builder: (context){
        return dialog;
      });
    }
  </code></pre>
  
  <p>This is my code.</p>
  
  <pre><code>I/flutter (31032): Looking up a deactivated widget's ancestor is unsafe.
  I/flutter (31032): At this point the state of the widget's element tree is no longer stable. To safely refer to a
  I/flutter (31032): widget's ancestor in its dispose() method, save a reference to the ancestor by calling
  I/flutter (31032): inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.
  I/flutter (31032): 
  </code></pre>