import 'package:flutter/material.dart';

class CirculoDiametro extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return Container(
      height: double.infinity,
      width: double.infinity,
      child: CustomPaint(
        painter: _CirculoDiametroPainter(),
      ),
    );
  }

}

class _CirculoDiametroPainter extends CustomPainter{
  @override
  void paint(Canvas canvas, Size size) {
    final paint = Paint();

    //Propiedades
    paint.color = Color(0xFF000000);
    paint.style = PaintingStyle.stroke;
    paint.strokeWidth = 2.0;

    final path = Path();

    //Dibujar
    path.moveTo(0, size.height*0.5);
    path.lineTo(size.width, size.height*0.5);

    canvas.drawPath(path, paint);
    canvas.drawCircle(Offset(size.width*0.5, size.height*0.5), size.width*0.5, paint);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) {
    return true;
  }

}