1、 一个圆,裁剪出一段圆border
ClipOval(
child: Container(
width: 56,
height: 56,
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(color: Colors.red, width: 1),
borderRadius: BorderRadius.all(Radius.circular(28)),
),
child: Container(),
),
clipper: MyClipper1(),
);
class MyClipper1 extends CustomClipper<Rect> {
@override
Rect getClip(Size size) {
return new Rect.fromLTRB(60, 20, size.width - 15.0, size.height + 20.0);
}
@override
bool shouldReclip(CustomClipper<Rect> oldClipper) {
return true;
}
}
效果图