title: Navigation.of(context) not going to another route
body: <p>I'm trying to go to a new route using the following code but it doesn't work. There are no errors showing up in my IDE and my code seems pretty similar to all the resources I've checked on how to go to a new page.</p>
  
  <p>I've compared my code to others online. I'm guessing its how I've implemented it. I have also tried using:</p>
  
  <pre><code>    MaterialPageRoute(builder: (context) =&gt; SecondRoute())
  </code></pre>
  
  <p>But that was not the issue. Here is most of my app:</p>
  
  <pre><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
  
      Widget setTimer = Container(
        decoration: BoxDecoration(
            border: Border.all(color: Colors.purpleAccent,width: 3)
        ),
        padding: EdgeInsets.all(32),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          children: &lt;Widget&gt;[
            RaisedButton(
              child: Text('Set Timer'),
              onPressed: (){
                //Go to the second route
                Navigator.of(context).pushNamed('/page2');
              },
            )
          ],
        ),
      );
      return MaterialApp(
        title: 'Hands Off',
        routes: &lt;String, WidgetBuilder&gt;{
          '/page2': (BuildContext context) =&gt; SecondRoute(),
        },
        home: Scaffold(
          appBar: AppBar(
            title: Text('Timer config'),
          ),
          body: Column(
            children: &lt;Widget&gt;[
  
              setTimer,
            ],
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <pre><code>class SecondRoute extends StatelessWidget{
    @override
    Widget build(BuildContext context) {
      Widget firstRouteButton = Container(
        child: Row(
          children: &lt;Widget&gt;[
            RaisedButton(
              child: Text('Go back'),
              onPressed: (){
                //Go back to main route (first route)
                Navigator.of(context).pop(true);
              },
            )
          ],
        ),
      );
      return Scaffold(
        appBar: AppBar(
          title: Text('hel'),
        ),
      );
    }
  }
  </code></pre>
  
  <p>It should go to a new page but whenever I press the button nothing happens. Can you guys explain why it doesn't work as well please?</p>