How to create a Container with boxshadow in flutter?

This Article is posted by seven.srikanth at 5/17/2020 4:59:16 AM



Here is an example of how to create a container with BoxShadow in flutter.

Container(
decoration: BoxDecoration(
boxShadow: [BoxShadow(color: Colors.grey, offset: Offset(5, 5), blurRadius: 1.0, spreadRadius: 1.0)],
color: Colors.white),
child: Padding(
padding: const EdgeInsets.all(38.0),
),
)
Here is another way to add shadow.

PhysicalModel(
color: Colors.green,
elevation: 20.0,
child: Container(
height: 150,
width: 150,
color: Colors.red,
),
),
Hope this helps.
Thanks,
Srikanth

Tags:








0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.


© 2018 - Fluttercentral | Email to me - seven.srikanth@gmail.com