Boxshadow appears behind other widgets

Posted by Andre Scott | Updated on

Boxshadow appears behind other widgets. It is happening because since you are using an Expanded widget inside Column, it is taking up all the available space on the screen and hence it looks like it is overlapping the Container but actually it’s just overlapping the shadow.

Instead of a Column widget, use a Stack to show the Container above the ListView. You can use Positioned widget to position the child widgets of the Stack.

But in this case, make sure you put the Container code after the ListView code so that it would always be on top.

Here is a quick example:

You can also wrap you ListView inside a Positioned widget if you want to provide a certain margin from top.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers