Flutter: Vertical viewport was given unbounded height. Viewports expand in the scrolling direction to fill their container
A scrollable (ListView, GridView) sits inside a parent that does not limit its height, so it tries to be infinitely tall.
Vertical viewport was given unbounded heightHorizontal viewport was given unbounded widthViewports expand in the scrolling direction to fill their containerRenderViewport does not support returning intrinsic dimensionsListView inside Column unbounded height Meaning
A Column gives children unbounded height. A ListView inside it wants to fill that infinite space and throws. Give the list a bounded height with Expanded, SizedBox or shrinkWrap, or use a CustomScrollView with slivers for mixed content.
Common causes
- ListView directly inside a Column
- ListView inside another scrollable (SingleChildScrollView)
- GridView inside Column without Expanded
- TabBarView or PageView inside Column without Expanded
- Missing height in a Row/Column nesting
⚡ Quick fix
- Wrap the ListView in
Expanded(child: …) - Or use
shrinkWrap: trueplusphysics: NeverScrollableScrollPhysics()for small lists - Use slivers for complex pages
Detailed fix by platform
Flutter
- A column with a header and list:
Column(children:[Header(), Expanded(child: ListView(...))])
Code examples
Bound the list
Column(
children: [
const Text('Header'),
Expanded( // gives the ListView a finite height
child: ListView.builder(
itemCount: items.length,
itemBuilder: (_, i) => ListTile(title: Text(items[i])),
),
),
],
)How to diagnose
- Parent — Column/Row/Scroll view?
- Fix — Expanded or fixed height?
- Alternative — Slivers?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- A RenderFlex overflowed Flutter: A RenderFlex overflowed by x pixels on the right/bottom
- Android license status unknown / licenses not accepted flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses
- BoxConstraints forces an infinite width Flutter: BoxConstraints forces an infinite width. These invalid constraints were provided to RenderStack's layout() function (TextField in a Row)
Most viewed in Flutter / Dart
- setState() called after dispose() Flutter: setState() called after dispose(): _MyState#1a2b3 (lifecycle state: defunct, not mounted)
- Null check operator used on a null value Dart/Flutter: Null check operator used on a null value
- SocketException: Failed host lookup Flutter: Unhandled Exception: SocketException: Failed host lookup: 'api.example.com' (OS Error: No address associated with hostname, errno = 7)
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026