I want to draw a custom shape similar to the marked area of below image. Is there a way to clip this custom shape with blur effect and then specify the radius for the corners?
You can set the shape property to RoundedRectangleBorder() or CircleBorder() in order to create a circle Card. If you use RoundedRectangleBorder, the key point here is to increase the border radius to a large number, at least half the width of the Card's child.
Flutter ElevatedButton With Rounded Corners we will change the style of ElevatedButton using style property. We can use ElevatedButton. styleFrom() and provide RoundedRectangleBorder as shape property value. BorderRadius.
Here is the full example
class Customclipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
var path = new Path();
path.lineTo(0.0, size.height - 20);
path.quadraticBezierTo(0.0, size.height, 20.0, size.height);
path.lineTo(size.width - 20.0, size.height);
path.quadraticBezierTo(size.width, size.height, size.width, size.height - 20);
path.lineTo(size.width, 50.0);
path.quadraticBezierTo(size.width, 30.0, size.width - 20.0, 30.0);
path.lineTo(20.0, 5.0);
path.quadraticBezierTo(0.0, 0.0, 0.0, 20.0);
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With