Want to add custom box shadow to Flutter card? The Card Widget doesn’t have decoration property so you need to make a card inside a Container and then apply the BoxShadow to the Container,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | class mycard extends StatelessWidget { @override Widget build(BuildContext context) { return new Container( child: new Card( child: new Center( child: new Icon( Icons.refresh, size: 150.0, ), ), ), decoration: new BoxDecoration(boxShadow: [ new BoxShadow( color: Colors.black, blurRadius: 20.0, ), ]), ); } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.