paintShadow method

void paintShadow(
  1. Canvas canvas,
  2. Rect rect
)

Implementation

void paintShadow(Canvas canvas, Rect rect) {
  final clipPath = Path()
    ..addRect(const Rect.fromLTWH(-2500, -2500, 5000, 5000))
    ..addPath(getInnerPath(rect), Offset.zero)
    ..fillType = PathFillType.evenOdd;
  canvas.clipPath(clipPath);

  for (final BoxShadow boxShadow in boxShadow) {
    final Paint paint = boxShadow.toPaint();
    final Rect bounds = rect.shift(boxShadow.offset).inflate(boxShadow.spreadRadius);

    canvas.drawPath(getOuterPath(bounds), paint);
  }
}