# Flutter: “Navigator operation requested with a context that does not include a Navigator”

> Navigator operation requested with a context that does not include a Navigator: the context sits above MaterialApp. Use a child widget, Builder or navigatorKey.

Canonical: https://app369.com/fix/flutter-navigator-operation-requested-with-a-context/
Last updated: 2026-11-08

Navigator.push or Navigator.pop throws: Navigator operation requested with a context that does not include a Navigator. Navigator.of(context) looks up the tree from the widget that owns that context. When that widget is the one that builds MaterialApp, the Navigator is below it, so there is nothing to find.

**Short answer**

Use a context from below MaterialApp. Move your home screen into its own widget (class HomePage extends StatelessWidget) and call Navigator from its build method, or wrap the button in a Builder to get a new context. To navigate from code with no context, such as a notification handler, give MaterialApp a navigatorKey and call navigatorKey.currentState.

## **Why the context has no Navigator, and the fix**

1. 01 ### **The context belongs to the widget that builds MaterialApp**
  > “If there is no Navigator in the given context, this function will throw a FlutterError in debug mode, and an exception in release mode.” [**Flutter, Navigator.of**](https://api.flutter.dev/flutter/widgets/Navigator/of.html) MaterialApp creates the Navigator, so the build method that returns MaterialApp gets a context from above it. Split the screen into its own widget; its context sits under MaterialApp.```
class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) => const MaterialApp(home: HomePage());
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});
  @override
  Widget build(BuildContext context) => Scaffold(
        body: TextButton(
          onPressed: () => Navigator.of(context).push(
            MaterialPageRoute(builder: (_) => const DetailsPage()), // your own screen widget
          ),
          child: const Text('Open'),
        ),
      );
}
```
2. 02 ### **A quick fix inside the same build method**
  > “This widget is an inline alternative to defining a StatelessWidget subclass.” [**Flutter, Builder class**](https://api.flutter.dev/flutter/widgets/Builder-class.html) If you’d rather not split the widget, wrap the part that navigates in a Builder. Its builder callback gets a new context below MaterialApp.```
MaterialApp(
  home: Builder(
    builder: (context) => TextButton(
      onPressed: () => Navigator.of(context).push(
        MaterialPageRoute(builder: (_) => const DetailsPage()),
      ),
      child: const Text('Open'),
    ),
  ),
)
```
3. 03 ### **Navigating from code that has no widget context**
  > “If a navigatorKey is specified, the Navigator can be directly manipulated without first obtaining it from a BuildContext via Navigator.of” [**Flutter, MaterialApp.navigatorKey**](https://api.flutter.dev/flutter/material/MaterialApp/navigatorKey.html) Push notification taps, auth state listeners and services don’t have a context under MaterialApp. Give MaterialApp a GlobalKey<NavigatorState> and navigate through it.```
final navigatorKey = GlobalKey<NavigatorState>();

void main() {
  runApp(MaterialApp(navigatorKey: navigatorKey, home: const HomePage()));
}

// anywhere, after the first frame (InboxPage is your own screen widget)
void openInbox() {
  navigatorKey.currentState?.push(
    MaterialPageRoute(builder: (_) => const InboxPage()),
  );
}
```

Checked against the vendor’s docs on November 8, 2026: [Flutter API: Navigator.of](https://api.flutter.dev/flutter/widgets/Navigator/of.html); [Flutter API: Builder class](https://api.flutter.dev/flutter/widgets/Builder-class.html); [Flutter API: MaterialApp.navigatorKey](https://api.flutter.dev/flutter/material/MaterialApp/navigatorKey.html).

## **Rather hand it over?**

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

- [from $450**App Fix Ticket**One reproducible bug in an existing mobile or web app, diagnosed and fixed.**See scope and start**](https://app369.com/fixed-price/flutter-firebase-bug-fix/)
- [from $450**AI-Built App Rescue**A Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.****No issues worth fixing, no charge.**** If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.**See scope and start**](https://app369.com/fixed-price/ai-app-rescue/)

Related: [**Flutter “Scaffold.of() called with a context”**](https://app369.com/fix/flutter-scaffold-of-called-with-a-context/) · [**Flutter “deactivated widget’s ancestor”**](https://app369.com/fix/flutter-looking-up-a-deactivated-widgets-ancestor-is-unsafe/) · [**Flutter setState() called during build**](https://app369.com/fix/flutter-setstate-called-during-build/) · [**Flutter “type 'Null' is not a subtype of type 'String'”**](https://app369.com/fix/flutter-type-null-is-not-a-subtype-of-type-string/)

Questions

## **More on this error**

<details>

<summary>**Does the same fix apply to go_router? **+</summary>

Similar cause, different error: go_router says No GoRouter found in context when context.go runs from a context above MaterialApp.router. Call it from a child widget or a Builder, or use the GoRouter object directly from code with no context.

</details>

<details>

<summary>**Why does it work in one screen but not on the first one? **+</summary>

Screens pushed by the Navigator are already below it. Only code in the widget that builds MaterialApp, or code outside the widget tree, has a context above it.

</details>

<details>

<summary>**Can you fix it for me? **+</summary>

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

</details>

A different error?

## **Describe it and get a written quote**

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.

[**Describe your problem **→](https://app369.com/contact/) [**All fixes**](https://app369.com/fix/)