title: how to navigated to other page in flutter by clicking on button?
body: <pre><code>Widget build(BuildContext context) {
      // TODO: implement build
      return MaterialApp(
        home: Scaffold(
          body: Container(
            padding: EdgeInsets.fromLTRB(10.0, 50.0, 10.0, 10.0),
            child: Column(
              children: [
                TextField(
                  controller: user,
                  decoration: InputDecoration(
                      border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(20.0)),
                      hintText: &quot;ENTER USER NAME&quot;),
                ),
                SizedBox(
                  height: 10.0,
                ),
                TextField(
                  controller: pass,
                  decoration: InputDecoration(
                      border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(20.0)),
                      hintText: &quot;ENTER USER NAME&quot;),
                ),
                FlatButton(
                    onPressed: () {
                      Navigator.push(context,
                          MaterialPageRoute(builder: (context) =&gt; Home()));
                    },
                    child: Text(&quot;NAVIGATOR&quot;))
              ],
            ),
          ),
        ),
      );
    }
  </code></pre>
  <p>getting error in navigator.push</p>
  <p>&quot;This is the error I am getting while on the press&quot;
  The following assertion was thrown while handling a gesture:</p>
  <p>Navigator operation requested with a context that does not include a Navigator.The context used to push or pop routes from the Navigator must be that of a widget that is a descendant of a Navigator widget.</p>