Incorrect use of ParentDataWidget Flutter / Dart Origin: On your device OSI layer 7 · Application Last updated 4 Nov 2026

Flutter: Incorrect use of ParentDataWidget. The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject

A widget like Expanded, Flexible, Positioned or TableCell was placed under a parent that does not support it.

Exact message you may see Incorrect use of ParentDataWidgetThe ParentDataWidget Expanded wants to apply ParentData of type FlexParentDataThe ParentDataWidget Positioned wants to apply StackParentDataTypically, Expanded widgets are placed directly inside Flex widgetsParentDataWidget incorrect use
Seen on: Flutter

Meaning

These widgets must be a direct child of a specific parent: Expanded/Flexible of Row/Column/Flex, Positioned of Stack, TableCell of TableRow. Extra wrappers such as Padding or Container between them break the relationship. Move the widget directly under the right parent.

Common causes

  • Expanded inside a Container, Padding or SizedBox instead of directly under a Row/Column
  • Positioned used outside a Stack
  • Expanded inside a ListView or Stack
  • Widget wrapper inserted between Expanded and Row
  • TableCell outside TableRow

⚡ Quick fix

  1. Make Expanded/Flexible a direct child of Row/Column/Flex
  2. Put Positioned directly inside Stack
  3. Move wrappers (Padding, Center) inside the Expanded

Detailed fix by platform

Flutter

  1. Fix pattern: Row(children: [Expanded(child: Padding(padding: EdgeInsets.all(8), child: Text('x')))])

How to diagnose

  1. Widget — Expanded, Positioned or TableCell?
  2. Parent — Correct direct parent?
  3. Wrapper — Anything in between?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

A RenderFlex overflowed — Flutter: A RenderFlex overflowed by x pixels on the right/bottom (Flutter / Dart)A RenderFlex overflow…Android license status unknown / licenses not accepted — flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses (Flutter / Dart)Android license statu…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) (Flutter / Dart)BoxConstraints forces…Cleartext HTTP traffic not permitted — Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted (Flutter / Dart)Cleartext HTTP traffi…Dependency requires compileSdk 34 or later — Android Gradle: Execution failed for task ':app:checkDebugAarMetadata'. Dependency requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs (Flutter / Dart)Dependency requires c…measured with an infinity maximum height — Jetpack Compose: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed (Android)measured with an infi…RenderBox was not laid out — Flutter: RenderBox was not laid out: RenderFlex#a1b2c relayoutBoundary=up2 NEEDS-PAINT — Failed assertion: 'hasSize' (Flutter / Dart)RenderBox was not lai…There are multiple heroes that share the same tag — Flutter: There are multiple heroes that share the same tag within a subtree (Flutter / Dart)There are multiple he…Incorrect…

Explore the map of this error Full error map →

🧠 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.