drawCursor method

  1. @override
void drawCursor(
  1. Canvas canvas,
  2. Size size,
  3. Rect rect,
  4. Cursor cursor
)
inherited

Implementation

@override
void drawCursor(Canvas canvas, Size size, Rect rect, Cursor cursor) {
  Paint paint = Paint()
    ..style = PaintingStyle.fill
    ..isAntiAlias = true
    ..color = cursor.color
    ..strokeWidth = cursor.width;
  double height = cursor.height ?? size.height / 3;

  RRect rRect = RRect.fromRectAndRadius(
      Rect.fromLTWH(rect.center.dx - cursor.width / 2,
          rect.center.dy - height / 2, cursor.width, height),
      cursor.radius);
  canvas.drawRRect(rRect, paint);
}