2
votes

Is there a way to completely remove the drop shadow under the RaisedButton? I've set elevation: 0 to that very RaisedButton but the drop shadow still appears when tapping it.

3

3 Answers

9
votes

RaisedButton has four different elevation parameters. Just set them all to 0.

elevation: 0,
hoverElevation: 0,
focusElevation: 0,
highlightElevation: 0,
6
votes

Since raised button is deprecated.

ElevatedButton(
                style: ElevatedButton.styleFrom(
                  elevation: 0.0,
                  shadowColor: Colors.transparent,
               
                ),),

This should be the solution. It will remove the elevation and the shadows.

2
votes

Since the RaisedButton is deprecated and ElevatedButton should be used insted, the solution for this problem is also simple.

elevation: MaterialStateProperty.all<double>(0)