{
  "id": "flutter/render-box-intersect-error",
  "signature": "FlutterError: RenderBox was not laid out: RenderRepaintBoundary#12345 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE",
  "signature_zh": "FlutterError：RenderBox 未布局：RenderRepaintBoundary#12345 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE",
  "regex": "RenderBox was not laid out: Render\\w+#\\d+ relayoutBoundary=\\w+ NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE",
  "domain": "flutter",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A widget's RenderBox is accessed for geometry before it has been laid out, often due to calling RenderBox.size in initState or before the first frame.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 RenderBox 布局完成前访问其几何属性，通常是因为在 initState 或第一帧之前调用了 RenderBox.size。",
  "versions": [
    {
      "version": "Flutter 3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Flutter 3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Dart 3.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "SizedBox forces a size but does not ensure layout is complete before accessing RenderBox; the underlying widget may still not be laid out.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "addPostFrameCallback runs after the first frame, but if accessed before the callback fires, the error persists.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The context may exist but the RenderBox may not be laid out yet; size is null until layout completes.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Delay RenderBox access until after the first frame using WidgetsBinding.instance.addPostFrameCallback and then access the GlobalKey's currentContext.size.",
      "success_rate": 0.85,
      "how": "Delay RenderBox access until after the first frame using WidgetsBinding.instance.addPostFrameCallback and then access the GlobalKey's currentContext.size.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a LayoutBuilder to get constraints and size without directly accessing RenderBox.",
      "success_rate": 0.9,
      "how": "Use a LayoutBuilder to get constraints and size without directly accessing RenderBox.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Delay RenderBox access until after the first frame using WidgetsBinding.instance.addPostFrameCallback and then access the GlobalKey's currentContext.size.",
    "Use a LayoutBuilder to get constraints and size without directly accessing RenderBox."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://api.flutter.dev/flutter/rendering/RenderBox/size.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}