I want to draw curve like image above can anyone help me if can ?
Asked
Active
Viewed 343 times
0

Mariam Younes
- 389
- 6
- 29
-
Follow this : https://stackoverflow.com/questions/57748469/flutter-how-to-draw-semicircle-half-circle add your logics and complete it – Awais Rehman Nov 11 '21 at 14:32
-
I was saw that but i can't make my own – Mariam Younes Nov 11 '21 at 20:14
-
then i will sueggest you to create a image adobe photoshop and simple call it in image.asset :-) – Awais Rehman Nov 12 '21 at 06:28
1 Answers
0
Try quadraticBezierTo
with Paint shader
. play with quadraticBezierTo
's value to meet your need.
class MyCustomPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
Path path = Path()
..lineTo(20, 0)
..quadraticBezierTo(size.width / 2, size.height / 2, size.width, 0)
..lineTo(size.width, 20)
..quadraticBezierTo(size.width / 2, size.height / 1.3, 0, 20);
Paint paint = Paint()
..shader =
LinearGradient(colors: [Colors.blue, Colors.blue.withOpacity(.4)])
.createShader(Rect.fromLTWH(0, 0, size.width, size.height));
canvas.drawPath(path, paint);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
}

Md. Yeasin Sheikh
- 54,221
- 7
- 29
- 56