How to add bottom elevation to a container in Flutter?

Benjamin picture Benjamin · Jan 16, 2020 · Viewed 26.5k times · Source

I've already seen this and this and this but they don't answer my question. I need elevation on my Container just below it, not all around it.

Here's what I have as of now:

container with shadow

My goal at the end is to eliminate the shadow at the top of the days of the week.

I use the code from this answer to achieve that shadow effect on my Container but I don't want it all the way around, just on the bottom with the rounded corners and not on the top. Any help would be appreciated.

Answer

Aashar Wahla picture Aashar Wahla · May 11, 2020

In my option the best way is to add Material() over the widget you are currently using.

return Material(
       elevation: 20,
       child Container(),
       );