{
  "id": "flutter/navigator-operation-requested-with-a-context-that-does-not-include-a-navigator",
  "signature": "FlutterError: Navigator operation requested with a context that does not include a Navigator",
  "signature_zh": "FlutterError: 使用不包含 Navigator 的上下文请求导航操作",
  "regex": "Navigator operation requested with a context that does not include a Navigator",
  "domain": "flutter",
  "category": "runtime_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用未位于 Navigator 小部件下的 BuildContext 调用 Navigator.push/pop/replace，通常来自无路由的覆盖层、对话框或 MaterialApp 构建之前。",
  "versions": [
    {
      "version": "Flutter 3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Flutter 3.13",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Flutter 3.16",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The context may become stale or detach from the tree; the error persists if the widget is no longer in a route.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The root context is above the Navigator; navigator operations require a descendant context.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "GlobalKey may still reference a disposed widget, yielding a context without a Navigator.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use Navigator.of(context, rootNavigator: true) to explicitly access the root navigator, or ensure the context is from a widget inside a MaterialApp/CupertinoApp.",
      "success_rate": 0.85,
      "how": "Use Navigator.of(context, rootNavigator: true) to explicitly access the root navigator, or ensure the context is from a widget inside a MaterialApp/CupertinoApp.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Wrap the navigation call in a post-frame callback to ensure the widget tree is built and the context is valid.",
      "success_rate": 0.9,
      "how": "Wrap the navigation call in a post-frame callback to ensure the widget tree is built and the context is valid.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use Navigator.of(context, rootNavigator: true) to explicitly access the root navigator, or ensure the context is from a widget inside a MaterialApp/CupertinoApp.",
    "Wrap the navigation call in a post-frame callback to ensure the widget tree is built and the context is valid."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://api.flutter.dev/flutter/widgets/Navigator-class.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-08-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}