title: Navigator operation requested with a context that does not include a Navigator
body: <p>I'm trying to start a new screen within an onTap but I get the following error:</p>
  
  <blockquote>
    <p>Navigator operation requested with a context that does not include a
    Navigator.</p>
  </blockquote>
  
  <p>The code I am using to navigate is:</p>
  
  <pre><code>onTap: () { Navigator.of(context).pushNamed('/settings'); },
  </code></pre>
  
  <p>I have set up a route in my app as follows:</p>
  
  <pre><code>routes: &lt;String, WidgetBuilder&gt;{
      '/settings': (BuildContext context) =&gt; new SettingsPage(),
  },
  </code></pre>
  
  <p>I've tried to copy the code using the stocks sample application. I've looked at the Navigator and Route documentation and can't figure out how the context can be made to include a Navigator. The <code>context</code> being used in the onTap is referenced from the parameter passed into the build method:</p>
  
  <pre><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
  </code></pre>
  
  <p>SettingsPage is a class as follows:</p>
  
  <pre><code>class SettingsPage extends Navigator {
  
  Widget buildAppBar(BuildContext context) {
    return new AppBar(
      title: const Text('Settings')
    );
  }
  
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: buildAppBar(context),
    );
   }
  }
  </code></pre>