4

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%

Drop Shadow

2 Answers2

9

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),
      ),
    ],
  ),
);

Screenshot enter image description here

Try the full code on DartPad

Guillaume Roux
  • 6,352
  • 1
  • 13
  • 38
1

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(),
    );
  }
MobIT
  • 880
  • 6
  • 15