Incorrect use of ParentData Widget. Expanded widget Must be Placed Inside the flex widget.
Oct 30, 2020
Expanded should only be descendant of a column, row or flex.
So, if anywhere expanded is Present in other than column , row or flex widget, try removing those widget.
For Example → Simply Using the Expanded wiget in the Conatiner can cause Error.
Container(
child: Text(
"Hello",
style: TextStyle(fontWeight: FontWeight.bold),
),
child: Expanded(
child: Text("HEY")
), ),
Try to wrap it in Column / Row or Flex Widget.
Column(
children: [
Container(
child: Text(
"Hello",
style: TextStyle(fontWeight: FontWeight.bold),
),
), Expanded(
child: Text("Hey"),
),
],
);
Simply wrap Expanded in the Row/Column or Flex widget and your Problem will be Solved.
Feel free to ask if you face any issue regarding this.