sebdoy
sebdoy

Reputation: 149

Incorrect use of ParentDataWidget - Is this an error we can simply ignore?

I'm aware this is a very common Flutter error: "Incorrect use of ParentDataWidget."

Is it really a big deal if I leave this error as it is because from what I'm seeing, the error isn't causing any interference in the app's functions nor the layout. My app is working perfectly, even with this error showing up in the console. Will it have any issues during release or potentially cause issues on other devices? I've never uploaded an app to the AppStore and I'm simply asking out of curiosity. Is it really worth fixing? Thank you.

Upvotes: 0

Views: 746

Answers (1)

Babul
Babul

Reputation: 1224

You shouldn't ignore this error. It through exceptions because you are not on the right way to design screen UI. It can produce UI broken or empty screen at the time of Rendering widget tree.

There are 3 things to get this problem

  • Under ListView don't use Spacer Widget

  • don't use Positioned under Row or Column

  • Expanded can only use it must be a descendant of Column, Row & Flex

    child Widget  Expanded(), parent widget: Row(), Column(), Flex()
    child  Widget Positioned(), parent widget :  Stack()
    child widget  TableCell(), parent Widget :   Table()
    

Always try to follow good practice. Happy coding.

Upvotes: 3

Related Questions