paint method

  1. @override
void paint(
  1. Canvas canvas,
  2. Size size
)
override

paint brush for particles

Implementation

@override
void paint(Canvas canvas, Size size) {
  final mainHandConvertedValueRelativeTo0And1 =
      LoaderConfig().mainHand / LoaderConfig().mainHandConverterValue;
  final color = (animation.value == 0 ||
      mainHandConvertedValueRelativeTo0And1 > animation.value)
      ? Colors.transparent
      : clockLoaderModel.particlesColor;
  var paint = Paint()
    ..color = color ?? Colors.white
    ..style = PaintingStyle.fill;

  final x1 = calculate(animation.value, path)?.dx ?? 0;
  final y1 = calculate(animation.value, path)?.dy ?? 0;
  clockLoaderModel.shapeOfParticles == ShapeOfParticlesEnum.square
      ? canvas.drawRect(
      Offset(x1, y1) & const Size(squareSize, squareSize), paint)
      : canvas.drawCircle(Offset(x1, y1), 5.2, paint);
}