Flutter Alert: Incorrect use of ParentDataWidget.

Exception caught by widgets library

Today I came across this exception and I am trying to figure out what could have caused the error.

======== Exception caught by widgets library =======================================================
The following assertion was thrown while applying parent data.:
Incorrect use of ParentDataWidget.

The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type ParentData.

Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets.
The offending Expanded is currently placed inside a RepaintBoundary widget.

So, I did a google search and an interesting article I found is here..

Maybe, I need to spend some time and modify or replace my Expanded Widget and post the solution here.

P.S. I removed the Expanded widget and the app worked fine.