I want to add shadow to a ClipPath I have created from Container. This is the ClipPath i created:
ClipPath(
clipper: RibbonClipper(),
child: Container(
height: 20,
width: 80,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(5.0),
bottomLeft: Radius.circular(5.0),
),
color: Color(0xFF338D5E),
),
),
),
And CustomClipper Path is:
@override
Path getClip(Size size) {
var path = Path();
path.lineTo(0, size.height);
path.lineTo(size.width, size.height);
path.lineTo(size.width * .90, size.height * .5);
path.lineTo(size.width, 0);
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) {
return true;
}
}
Solution 1: MickaelHrndz
I had to do that a while ago. I found this very useful gist that combines ClipPath and shadows. Alternatively, it seems like someone made it a package, but I didn't test it.