toPaint method

  1. @override
Paint toPaint ()

Create the Paint object that corresponds to this shadow description.

The offset and spreadRadius are not represented in the Paint object. To honor those as well, the shape should be inflated by spreadRadius pixels in every direction and then translated by offset before being filled using this Paint.


Paint toPaint() {
  final Paint result = Paint()
    ..color = color
    ..maskFilter = MaskFilter.blur(BlurStyle.normal, blurSigma);
  assert(() {
    if (debugDisableShadows)
      result.maskFilter = null;
    return true;
  return result;