I have a figma design and I need to set box shadow like this.
Drop shadow
x 0, y : 1, B: 5, S: 0, #000000 30%
I have a figma design and I need to set box shadow like this.
Drop shadow
x 0, y : 1, B: 5, S: 0, #000000 30%
Use a Container
widget and set the boxShadow
property from its decoration
property.
Code Sample
Container(
height: 75,
width: 150,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
offset: Offset(0, 1),
blurRadius: 5,
color: Colors.black.withOpacity(0.3),
),
],
),
);
You can use Container and BoxDecoration
Container(
padding: EdgeInsets.symmetric(vertical: 1, horizontal: 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
offset: Offset(0, 1),
blurRadius: 5,
spreadRadius: 0,
)
],
),
child: Container(),
);
}