Skip to content

Instantly share code, notes, and snippets.

@adityajoshi12
Created January 2, 2020 07:18
Show Gist options
  • Save adityajoshi12/ba726dfcea29e833c42a90d20bc74af2 to your computer and use it in GitHub Desktop.
Save adityajoshi12/ba726dfcea29e833c42a90d20bc74af2 to your computer and use it in GitHub Desktop.
class CurvedClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
var path = new Path();
path.lineTo(0.0, size.height - 40);
path.quadraticBezierTo(
size.width / 4, size.height, size.width / 2, size.height);
path.quadraticBezierTo(
size.width - (size.width / 4), size.height, size.width, size.height);
path.lineTo(size.width, 0.0);
path.close();
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) => true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment