A Flutter Column does not expand to fill the screen
The Column and its children are narrow and centeredShort answer
A Column is as tall as its incoming constraints by default but only as wide as its widest child, and it does not stretch children for you. Set crossAxisAlignment to stretch for width, wrap a child in Expanded for height, and never put Expanded in a Column inside a ListView, which has unbounded height.
Fix it fast
1Find out which cause you have
Turn on the Flutter inspector's layout explorer, or wrap the Column in a colored Container, to see how much space it really takes.
Container(color: Colors.amber, child: Column(children: [/* ... */]))2Match what you see, then jump to its fix
- 1
Everything is narrow and centered horizontallyWidth follows the widest childFix - 2
The Column fills the screen but a child stays smallA child needs Expanded to take the remaining heightFix - 3
Exception: children with non-zero flex but the vertical constraints are unboundedThe Column sits in a ListView or other unbounded parentFix
- 1
What does the error look like?
The Column and its children are narrow and centeredThere are children with non-zero flex but the vertical constraints are unbounded
Cause 1 of 3
Width follows the widest child
1Check
The width of a Column is the maximum width of its children, and crossAxisAlignment defaults to center.
grep -rn "Column(" lib/2Fix
Set crossAxisAlignment to stretch, which gives children tight horizontal constraints equal to the incoming maximum width.
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [Text('Title'), ElevatedButton(onPressed: () {}, child: Text('Go'))],
)3Verify
The children now span the full width.
flutter runConfirmed by api.flutter.dev
Cause 2 of 3
A child needs Expanded to take the remaining height
1Check
A Column with mainAxisSize max takes the full incoming height, but children keep their own height unless wrapped in Expanded.
grep -rn "Expanded" lib/2Fix
Wrap the child that should grow in Expanded. The layout docs say Expanded ignores the child's own preferred size.
Column(
children: [
Text('Header'),
Expanded(child: Container(color: Colors.blue)),
],
)3Verify
The blue box fills everything under the header.
flutter runConfirmed by docs.flutter.dev
Cause 3 of 3
The Column sits in a ListView or other unbounded parent
1Check
A vertical scrollable provides infinite height, so Expanded and Flexible cannot work inside it.
grep -rn "ListView\|SingleChildScrollView" lib/2Fix
Remove Expanded or Flexible from the inner children, give the Column a fixed-height parent, or move the Column outside the scrollable.
SizedBox(
height: 400,
child: Column(children: [Expanded(child: Placeholder())]),
)3Verify
The exception is gone.
flutter runConfirmed by api.flutter.dev
How do I stop it coming back?
- Remember the rule: constraints go down, sizes go up, the parent sets the position.
- Be specific about alignment instead of hoping a child fills its parent.
- Use the layout explorer while building a screen.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Qist BazaarA buy-now-pay-later marketplace built from a blank repo, now past 100K downloads on Google Play.
- SessionBirdAn omnichannel engagement suite in Flutter: campaigns, chatbot, tickets, analytics and live calling.
Related fixes
Mobile apps
A Flutter Row or Column shows yellow and black stripes and says it overflowed
The overflowing RenderFlex has an orientation of Axis.horizontal.
A RenderFlex is a Row or Column.
3 causes, each with a fixMobile apps
AudioCache has no play method after updating audioplayers
The method 'play' isn't defined for the type 'AudioCache'.
Since audioplayers 1.0, AudioCache only turns asset files into local files and caches them.
2 causes, each with a fixMobile apps
Flutter Bloc throws that emit was called after the event handler completed
emit was called after an event handler completed normally.
Each on<Event> handler gets its own Emitter, and it stops working the moment the handler's returned Future completes.
2 causes, each with a fixMobile apps
analysis_options.yaml: the URI it includes can't be found
include_file_not_found
The analyzer reports include_file_not_found when the file named after include: in analysis_options.yaml does not resolve.
2 causes, each with a fixMobile apps
Dart error: the body might complete normally and return null for a non-nullable type
body_might_complete_normally
Dart found a path through your function or callback that reaches the closing brace without a return.
3 causes, each with a fixMobile apps
Dart throws ConcurrentModificationError while looping over a list
ConcurrentModificationError
Dart throws this when a collection changes size while something iterates it.
2 causes, each with a fix