draw method

void draw(
  1. Canvas canvas,
  2. Size size,
  3. Paint paint
)

Implementation

void draw(Canvas canvas, Size size, Paint paint) {
  final Rect rect = Rect.fromCenter(
    center: pos,
    width: width,
    height: height,
  );

  paint
    ..color = color
    ..style = fillShape ? PaintingStyle.fill : PaintingStyle.stroke;
  canvas.drawPath(shape.getOuterPath(rect), paint);

  if (velocity.dy < 0) {
    velocity += acceleration;
    pos += velocity;
  } else {
    exploded = true;
  }
}