Open privateGenish opened 5 years ago
Like this:
class BadPath extends parse.PathProxy {
Path path = Path();
@override
void close() { path.close() }
@override
void moveTo(double x, double y) { path.moveTo(x, y); }
@override
void cubicTo(
double x1, double y1, double x2, double y2, double x3, double y3) { path.cubicTo(x1, y1, x2, y2, x3, y3); }
@override
void lineTo(double x, double y) { path.lineTo(x, y); }
}
class TopDecoration extends CustomPainter {
final String topDecoration =
'M832.165,316.589c-73.605,86.636-219.245,55.9-375,50.662-.073.031.021-271.25.021-271.25H832.165Z';
@override
void paint(Canvas canvas, Size size) {
Paint paint = Paint();
BadPath path = BadPath();
parse.writeSvgPathDataToPath(topDecoration, path);
canvas.drawPath(path.path, paint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
// TODO: implement shouldRepaint
return false;
}
}
There are other probably cleaner ways, but that's the idea.
thank you so much! this is a great rep!
i used the same code as you posted, yet flutter dont paint it... i added a color property and still no paint.
how am i suppose to draw the path if it's a proxy path?