I'm trying to start a new screen within an onTap but I get the following error:

> 
> Navigator operation requested with a context that does not include a
>  Navigator.
> 
> 
> 

The code I am using to navigate is:

```
onTap: () { Navigator.of(context).pushNamed('/settings'); },

```

I have set up a route in my app as follows:

```
routes: <String, WidgetBuilder>{
    '/settings': (BuildContext context) => new SettingsPage(),
},

```

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 `context` being used in the onTap is referenced from the parameter passed into the build method:

```
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

```

SettingsPage is a class as follows:

```
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),
  );
 }
}

```