I want to create a button with custom painter like this. I am new to flutter, so I think it can be achieved by custom painter.

That is the code I have written, but it only designs the rectangle
class CurvePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
var paint = Paint()
..color = Color(0xFFE32087)
..style = PaintingStyle.fill;
final a = Offset(size.width * 2 / 1, size.height * 1 / 4);
final b = Offset(size.width * 5 / 9, size.height * 3 / 4);
final rect = Rect.fromPoints(a, b);
final radius = Radius.circular(3);
canvas.drawRRect(RRect.fromRectAndRadius(rect, radius), paint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return true;
}
}

