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);

  fillShape
      ? canvas.drawPath(
          shape.getOuterPath(
            rect,
          ),
          paint,
        )
      : shape
          .copyWith(
            side: shape.side.copyWith(
              color: color,
            ),
          )
          .paint(
            canvas,
            rect,
          );

  velocity += acceleration;
  velocity.dy < 0 ? pos += velocity : exploded = true;
}