{
  "id": "flutter/rendering-box-height-nan",
  "signature": "RenderBox was not laid out: RenderViewport#abcde needs to have a 'size' but its constraints are 'BoxConstraints(unconstrained)'",
  "signature_zh": "RenderBox 未布局：RenderViewport#abcde 需要具有 'size'，但其约束为 'BoxConstraints(unconstrained)'",
  "regex": "RenderBox was not laid out: RenderViewport.* needs to have a 'size' but its constraints are 'BoxConstraints\\(unconstrained\\)'",
  "domain": "flutter",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A scrollable widget (e.g., ListView, GridView) is placed inside a Column or Row without being given explicit constraints, causing infinite height.",
  "root_cause_type": "generic",
  "root_cause_zh": "可滚动小部件（例如 ListView、GridView）放置在 Column 或 Row 中，未获得显式约束，导致高度无限。",
  "versions": [
    {
      "version": "3.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.16.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.22.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If content exceeds the fixed height, the ListView will overflow or clip; not adaptive.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Expanded requires bounded constraints; if parent is unconstrained, it still fails.",
      "fail_rate": 0.35,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Does not give the ListView bounded constraints; the Column still tries to size itself to the ListView's infinite height.",
      "fail_rate": 0.25,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Wrap the scrollable widget in an Expanded or Flexible inside a Column or Row to give it bounded constraints.",
      "success_rate": 0.9,
      "how": "Wrap the scrollable widget in an Expanded or Flexible inside a Column or Row to give it bounded constraints.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a CustomScrollView with slivers instead of nesting a ListView in a Column.",
      "success_rate": 0.85,
      "how": "Use a CustomScrollView with slivers instead of nesting a ListView in a Column.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set a specific height constraint using SizedBox or Container with a height, but ensure it's enough for content.",
      "success_rate": 0.75,
      "how": "Set a specific height constraint using SizedBox or Container with a height, but ensure it's enough for content.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Wrap the scrollable widget in an Expanded or Flexible inside a Column or Row to give it bounded constraints.",
    "Use a CustomScrollView with slivers instead of nesting a ListView in a Column.",
    "Set a specific height constraint using SizedBox or Container with a height, but ensure it's enough for content."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://api.flutter.dev/flutter/rendering/RenderViewport-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-05-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}