现在让我解释一下到目前为止我已经做了什么以及如何得到结果
我尝试使用custompainter类,但得到这样的结果:
enum CircleAlignment {
topLeft,
topRight,
bottomLeft,
bottomRight,
}
class QuarterCirclePainter extends CustomPainter {
final CircleAlignment circleAlignment;
final Color color;
const QuarterCirclePainter({this.circleAlignment, this.color});
@override
void paint(Canvas canvas, Size size) {
final radius = math.min(size.height, size.width-80);
final offset = circleAlignment == CircleAlignment.topLeft
? Offset(.0, .0)
: circleAlignment == CircleAlignment.topRight
? Offset(size.width, 5)
: circleAlignment == CircleAlignment.bottomLeft
? Offset(.0, size.height+10)
: Offset(size.width, size.height);
canvas.drawCircle(offset, radius, Paint()..color = color);
}
@override
bool shouldRepaint(QuarterCirclePainter oldDelegate) {
return color == oldDelegate.color &&
circleAlignment == oldDelegate.circleAlignment;
}
}
但是正在得到这样的结果:
任何人都知道如何执行此操作吗?
[我正在尝试使半圆形像容器中的图像一样,我已经尝试了很多,但是不知道如何制作这个。现在让我解释一下到目前为止我已经尝试了什么以及如何得到结果。 。