【发布时间】:2020-09-17 01:11:46
【问题描述】:
我有这个形状 enter image description here
我想把它翻转成这样
这是原始代码
class CustomMenuClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
Paint paint = Paint();
paint.color = Colors.white;
final width = size.width;
final height = size.height;
Path path = Path();
path.moveTo(0, 0);
path.quadraticBezierTo(0, 8, 10, 16);
path.quadraticBezierTo(width - 1, height / 2 - 20, width, height / 2);
path.quadraticBezierTo(width + 1, height / 2 + 20, 10, height - 16);
path.quadraticBezierTo(0, height - 8, 0, height);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) {
return true;
}
}
这是github repository 如果是半圆,我不介意。
【问题讨论】:
-
欢迎来到 SO 但请记住:提交后至少要查看您的帖子。您的图片不正确,因为您忘记了the exclamation point that turns them into images。
标签: flutter bezier clip-path flutter-clippath