shouldRepaint method

  1. @override
bool shouldRepaint(
  1. covariant CustomPainter oldDelegate
)
override

Determines whether the painter should repaint.

Returns true if any of the visual properties (color, stroke width, dash length, or dash gap) have changed since the last paint.

Implementation

@override
bool shouldRepaint(CustomPainter oldDelegate) {
  return oldDelegate is! DashedCirclePainter ||
      oldDelegate.color != color ||
      oldDelegate.strokeWidth != strokeWidth ||
      oldDelegate.dashLength != dashLength ||
      oldDelegate.dashGap != dashGap;
}