Remove or modify navigation drawer overlay shadow in Flutter
Solution 1
If you want to get rid of the shadow over the Scaffold body then you have to change the Scaffold's drawerScrimColor
's value to Colors.transparent
.
Solution 2
Have you tried setting the drawer's elevation
to elevation: 0.0
?
Solution 3
check this
drawerTheme:
DrawerThemeData(scrimColor: Colors.transparent, elevation: 0.5),
Vince Varga
Updated on December 10, 2022Comments
-
Vince Varga over 1 year
I created a
Scaffold
widget withappBar
anddrawer
.As I open the drawer, there is a shadow over the
Scaffold
'sbody
widget. I'd like to either remove the shadow, make it not so "strong" or change the shade slightly.I checked the docs and I didn't find any way to achieve this through public API.
Is there any way to remove the drawer menu's "drop shadow" on the body?
The elevation option is something different, even if I set it to 0, the overlay shadow on top of the body is still present.
This issue's description's screenshots might help clarify what I want.
-
Vince Varga about 5 yearsYes, I mentioned it in the question: "The elevation option is something different, even if I set it to 0, the overlay shadow on top of the body is still present."
-
Vince Varga about 5 yearsAwesome, it's been added in this PR: github.com/flutter/flutter/pull/31025