1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
void arcTo(Rect rect, double startAngle, double sweepAngle, bool forceMoveTo) { }
class ArcWidget extends StatefulWidget { const ArcWidget({super.key});
@override State<ArcWidget> createState() => _ArcWidgetState(); }
class _ArcWidgetState extends State<ArcWidget> { @override Widget build(BuildContext context) { return Container( height: 50.h, child: CustomPaint( painter: ArcPainter(), child: Container(), ), ); } }
class ArcPainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { final paint = Paint() ..color = Colors.white ..style = PaintingStyle.fill;
final path = Path() ..moveTo(0, size.height + 1) ..lineTo(0, size.height - 10.h) ..quadraticBezierTo(size.width / 2, size.height - 48.h, size.width, size.height - 10.h) ..lineTo(size.width, size.height + 1) ..close();
canvas.drawPath(path, paint); }
@override bool shouldRepaint(CustomPainter oldDelegate) => true; }
|