paintShadow method

void paintShadow(
  1. Canvas canvas, {
  2. Path? path,
})

Implementation

void paintShadow(Canvas canvas, {Path? path}) {
  if (path != null) {
    innerPath = path;
  }
  canvas.save();
  canvas.clipPath(innerPath);
  var virtualBoxPath = path;

  virtualBoxPath ??= Path.combine(PathOperation.difference,
      shape.getOuterPath(outerRect.inflate(30)), innerPath);

  for (final shadow in innerShadows) {
    final shadowPaint = Paint()
      ..color = shadow.color
      ..maskFilter = MaskFilter.blur(BlurStyle.normal, shadow.blurSigma);
    canvas.drawPath(virtualBoxPath.shift(shadow.offset), shadowPaint);
  }

  canvas.restore();
}