79327608

Date: 2025-01-03 20:34:11
Score: 0.5
Natty:
Report link

BoxShadow.offset defines the direction in which the shadow is moved. It takes an Offset(dx, dy) object as a value. Where dx is offset by the x-axis and dy is offset by the y-axis.

Offset(0, 0):

enter image description here

No offset. The source of light is above the center of the container.

Offset(20, 0):

enter image description here

dx = 20. Shadow moved to the right 20px. The source of light is on the left side.

Offset(-20, 0):

enter image description here

dx = -20. Shadow moved to the left 20px. The source of light is on the right side.

Offset(0, 20):

enter image description here

dy = 20. I don’t see the logic here. Why the y-axis is directed down? If positive dx moves the shadow to the right, then positive dy should move the shadow up. But ok, we have what we have.

Offset(0, -20):

enter image description here

Offset(-20, -20):

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • High reputation (-1):
Posted by: Yuriy N.