drawTrackBall function

void drawTrackBall(
  1. Canvas canvas,
  2. Size size,
  3. double xTrackBall,
  4. int labelCount,
)

Implementation

void drawTrackBall(
    Canvas canvas, Size size, double xTrackBall, int labelCount) {
  //definir os pontos iniciais do trackball
  if (xTrackBall == 0) {
    xTrackBall = 10;
  }

  double yTrackBall = 10;

  final paint = Paint()
    ..color = const Color.fromARGB(255, 90, 90, 90)
    ..style = PaintingStyle.stroke
    ..strokeWidth = 2;

  Path path = Path();

  path.moveTo(xTrackBall, yTrackBall);
  path.lineTo(xTrackBall, size.height - 30);
  path.close();
  canvas.drawPath(path, paint);
}