toPaint method

Paint toPaint ()

Create the Paint object that corresponds to this shadow description.

The offset is not represented in the Paint object. To honor this as well, the shape should be translated by offset before being filled using this Paint.

This class does not provide a way to disable shadows to avoid inconsistencies in shadow blur rendering, primarily as a method of reducing test flakiness. toPaint should be overriden in subclasses to provide this functionality.


Paint toPaint() {
  return Paint()
    ..color = color
    ..maskFilter = MaskFilter.blur(BlurStyle.normal, blurSigma);