{
  "id": "flutter/assertion-failed-vertical-viewport",
  "signature": "Assertion failed: 'verticalDirection' is null or not set",
  "signature_zh": "断言失败：'verticalDirection' 为 null 或未设置",
  "regex": "Assertion failed: 'verticalDirection' is null or not set",
  "domain": "flutter",
  "category": "assertion_error",
  "subcategory": null,
  "root_cause": "A vertical viewport (e.g., ListView, Column) is used without specifying a constrained height, causing infinite vertical space.",
  "root_cause_type": "generic",
  "root_cause_zh": "垂直视口（例如 ListView、Column）在没有指定约束高度的情况下使用，导致无限垂直空间。",
  "versions": [
    {
      "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"
    },
    {
      "version": "Flutter 3.19",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Wrapping the ListView in an Expanded widget inside a Column",
      "why_fails": "Expanded only works when the parent has a fixed height; if the Column itself is unbounded, it still fails.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting shrinkWrap: true on the ListView without also constraining the parent",
      "why_fails": "ShrinkWrap only affects the viewport's own size calculation; the parent widget must still provide a finite height constraint.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using Flexible instead of Expanded",
      "why_fails": "Flexible also requires a bounded parent; same fundamental issue.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Wrap the ListView in a Container or SizedBox with a fixed height:\nSizedBox(\n  height: 300,\n  child: ListView(\n    children: [...],\n  ),\n)",
      "success_rate": 0.95,
      "how": "Wrap the ListView in a Container or SizedBox with a fixed height:\nSizedBox(\n  height: 300,\n  child: ListView(\n    children: [...],\n  ),\n)",
      "condition": "",
      "sources": []
    },
    {
      "action": "If inside a Column, wrap the ListView in an Expanded and ensure the Column has a bounded height (e.g., by wrapping the Column in a SizedBox or Expanded):\nColumn(\n  children: [\n    Expanded(\n      child: ListView(children: [...]),\n    ),\n  ],\n)",
      "success_rate": 0.9,
      "how": "If inside a Column, wrap the ListView in an Expanded and ensure the Column has a bounded height (e.g., by wrapping the Column in a SizedBox or Expanded):\nColumn(\n  children: [\n    Expanded(\n      child: ListView(children: [...]),\n    ),\n  ],\n)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a CustomScrollView with slivers if you need mixed scrolling and non-scrolling content.",
      "success_rate": 0.85,
      "how": "Use a CustomScrollView with slivers if you need mixed scrolling and non-scrolling content.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Wrap the ListView in a Container or SizedBox with a fixed height:\nSizedBox(\n  height: 300,\n  child: ListView(\n    children: [...],\n  ),\n)",
    "If inside a Column, wrap the ListView in an Expanded and ensure the Column has a bounded height (e.g., by wrapping the Column in a SizedBox or Expanded):\nColumn(\n  children: [\n    Expanded(\n      child: ListView(children: [...]),\n    ),\n  ],\n)",
    "Use a CustomScrollView with slivers if you need mixed scrolling and non-scrolling content."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://api.flutter.dev/flutter/widgets/ScrollView-class.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.93,
  "resolvable": "true",
  "first_seen": "2023-09-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}