# RenderBox was not laid out: RenderViewport#abcde needs to have a 'size' but its constraints are 'BoxConstraints(unconstrained)'

- **ID:** `flutter/rendering-box-height-nan`
- **Domain:** flutter
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A scrollable widget (e.g., ListView, GridView) is placed inside a Column or Row without being given explicit constraints, causing infinite height.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.0.0 | active | — | — |
| 3.10.0 | active | — | — |
| 3.16.0 | active | — | — |
| 3.22.0 | active | — | — |

## Workarounds

1. **Wrap the scrollable widget in an Expanded or Flexible inside a Column or Row to give it bounded constraints.** (90% success)
   ```
   Wrap the scrollable widget in an Expanded or Flexible inside a Column or Row to give it bounded constraints.
   ```
2. **Use a CustomScrollView with slivers instead of nesting a ListView in a Column.** (85% success)
   ```
   Use a CustomScrollView with slivers instead of nesting a ListView in a Column.
   ```
3. **Set a specific height constraint using SizedBox or Container with a height, but ensure it's enough for content.** (75% success)
   ```
   Set a specific height constraint using SizedBox or Container with a height, but ensure it's enough for content.
   ```

## Dead Ends

- **** — If content exceeds the fixed height, the ListView will overflow or clip; not adaptive. (40% fail)
- **** — Expanded requires bounded constraints; if parent is unconstrained, it still fails. (35% fail)
- **** — Does not give the ListView bounded constraints; the Column still tries to size itself to the ListView's infinite height. (25% fail)
