---
title: "How do you fix \"A RenderFlex overflowed by pixels\" in Flutter?"
description: "A Row or Column has more content than space. Wrap children in Expanded or Flexible, make the content scrollable, or shorten the text."
url: "https://bugsee.com/answers/flutter/fix-renderflex-overflowed/"
---

# How do you fix "A RenderFlex overflowed by pixels" in Flutter?

A `Row` or `Column` received children larger than the space available. Wrap flexible children in `Expanded` or `Flexible`, or put the content in a scroll view.

```dart
// Overflows when the title is long
Row(children: [Icon(Icons.info), Text(longTitle)]);

// Fix 1: let the text take the remaining width and wrap or ellipsize
Row(children: [
  Icon(Icons.info),
  Expanded(child: Text(longTitle, overflow: TextOverflow.ellipsis)),
]);

// Fix 2: vertical overflow, usually when the keyboard opens
SingleChildScrollView(child: Column(children: fields));
```

The yellow and black stripes in debug builds show the edge that overflowed. `Expanded` fills the free space, `Flexible` allows a child to be smaller than that space, and a scroll view removes the limit entirely. Check the parent's constraints in the Flutter Inspector if the cause is not obvious.

## Related questions

- [How do you fix "setState() called after dispose()" in Flutter?](https://bugsee.com/answers/flutter/fix-setstate-called-after-dispose/)
