# FlutterError: Navigator operation requested with a context that does not include a Navigator

- **ID:** `flutter/navigator-operation-requested-with-a-context-that-does-not-include-a-navigator`
- **Domain:** flutter
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Navigator.push/pop/replace is called using a BuildContext that is not under a Navigator widget in the widget tree, typically from a context in a route-less overlay, dialog, or before MaterialApp is built.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Flutter 3.10 | active | — | — |
| Flutter 3.13 | active | — | — |
| Flutter 3.16 | active | — | — |

## Workarounds

1. **Use Navigator.of(context, rootNavigator: true) to explicitly access the root navigator, or ensure the context is from a widget inside a MaterialApp/CupertinoApp.** (85% success)
   ```
   Use Navigator.of(context, rootNavigator: true) to explicitly access the root navigator, or ensure the context is from a widget inside a MaterialApp/CupertinoApp.
   ```
2. **Wrap the navigation call in a post-frame callback to ensure the widget tree is built and the context is valid.** (90% success)
   ```
   Wrap the navigation call in a post-frame callback to ensure the widget tree is built and the context is valid.
   ```

## Dead Ends

- **** — The context may become stale or detach from the tree; the error persists if the widget is no longer in a route. (80% fail)
- **** — The root context is above the Navigator; navigator operations require a descendant context. (90% fail)
- **** — GlobalKey may still reference a disposed widget, yielding a context without a Navigator. (70% fail)
