Scaleup Infotech
Scaleup Infotech.
Back to Blog
Bug Fixes6 min read

Fix Flutter 'Vertical viewport was given unbounded height'

Scaleup Infotech

Scaleup Infotech

Software & Marketing Agency

May 07, 2026
Fix Flutter 'Vertical viewport was given unbounded height'
FlutterLayoutListView

Putting a scrollable ListView directly inside a Column confuses Flutter: the Column offers infinite height, but the ListView needs a bounded height to know how big to be. You have to constrain it.

The Error

Vertical viewport was given unbounded height. RenderBox was not laid out.

Fix 1: Wrap the ListView in Expanded

dart
Column(
  children: [
    const Header(),
    Expanded(           // gives the ListView a bounded height
      child: ListView(children: items),
    ),
  ],
)

Fix 2: shrinkWrap for a Short, Non-Scrolling List

dart
ListView(
  shrinkWrap: true,
  physics: const NeverScrollableScrollPhysics(),
  children: items, // sizes to content; let the parent scroll
)

Don't shrinkWrap Big Lists

shrinkWrap measures every child up front — fine for 5 items, terrible for 5,000. For long lists, use Expanded or a CustomScrollView with slivers.

Share this article:

Keep Reading

Ready to implement these ideas?

Work With Scaleup Infotech