render method
Implementation
@override
void render(Canvas canvas) {
super.render(canvas);
//ParĂ¡metros
double r = size.x / 2;
double rc = (1 / 3) * size.x;
double rp = (1 / 4) * size.x;
//Dibujar el tallo
canvas.drawLine(
Offset(r, (5 / 6) * r),
Offset(r, size.y),
Paint()
..color = const Color.fromARGB(255, 66, 201, 12)
..strokeWidth = (1.25 / 3) * r,
);
//Petalos
canvas.drawCircle(
Offset((1 / 6) * size.x, (1 / 6) * size.y),
rp,
paint..strokeWidth = 4,
);
canvas.drawCircle(
Offset((5 / 6) * size.x, (1 / 6) * size.y),
rp,
paint..strokeWidth = 4,
);
canvas.drawCircle(
Offset((3 / 6) * size.x, (1 / 15) * size.y),
rp,
paint..strokeWidth = 4,
);
canvas.drawCircle(
Offset((2 / 10) * size.x, (3 / 6) * r + r),
rp,
paint..strokeWidth = 4,
);
canvas.drawCircle(
Offset((8 / 10) * size.x, (3 / 6) * r + r),
rp,
paint..strokeWidth = 4,
);
canvas.drawCircle(
Offset((3 / 6) * size.x, (3 / 7) * size.y),
rp,
paint..strokeWidth = 4,
);
//Pistillo
canvas.drawCircle(
Offset(r, r),
rc,
Paint()
..color = const Color.fromARGB(255, 255, 196, 0)
..strokeWidth = 4,
);
}