Hello guys how are you all? Hope you all are fine. As we know RaisedButton is deprecated and the Elevated button is replacing Raised Button widget with its new features. Here in this tutorial, we are going to learn How can I add shadow to the widget in Flutter?
Table of Contents
How can I add shadow to the widget in flutter?
Want to give Shadow and Elevation to ElevatedButton? we can use ElevatedButton.styleFrom and this property has shadowColor Property with Elevation property. so you can simply give shadow with elevation in ElevatedButton. Let’s explore examples.
Example
ElevatedButton(
child: Text('FlutterCorner.com'),
style: ElevatedButton.styleFrom(
onPrimary: Colors.white,
shadowColor: Colors.red,
elevation: 20,
),
onPressed: () {
print('Button Pressed');
},
)
Output

Faq
- How can I add shadow to the widget in flutter?
Want to give Shadow and Elevation to ElevatedButton? we can use ElevatedButton.styleFrom and this property has shadowColor Property with Elevation property. so you can simply give shadow with elevation in ElevatedButton. Let’s explore examples.
- Add shadow to the widget in flutter
Want to give Shadow and Elevation to ElevatedButton? we can use ElevatedButton.styleFrom and this property has shadowColor Property with Elevation property. so you can simply give shadow with elevation in ElevatedButton. Let’s explore examples.
Summery
So it’s all About this tutorial. Hope this above-all solution helped you a lot. Comment below Your thoughts and your queries. Comment Below on your suggestion.
Check Out Below Article
- How to add custom back button in Flutter AppBar ?
- remove back button on appbar in flutter?
- How to add a ListView to a Column in Flutter?
- Error: The non-abstract class ‘InternalSelectableMathState’ is missing implementations for these members
- xcodebuild: error: Could not resolve package dependencies: Internal error: missingPackageDescriptionModule