Last active
January 29, 2019 16:34
-
-
Save umuieme/cd0f453bb9ea07848594dcf793483d0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ZigZagClipper extends CustomClipper<Path> { | |
ClipType clipType; | |
ZigZagClipper(this.clipType); | |
@override | |
Path getClip(Size size) { | |
Path path = Path(); // the starting point is the 0,0 position of the widget. | |
path.lineTo(0, size.height); // this draws the line from current point to the left bottom position of widget | |
path.lineTo(size.width, size.height); // this draws the line from current point to the right bottom position of the widget. | |
path.lineTo(size.width, 0); // this draws the line from current point to the right top position of the widget | |
path.close(); // this closes the loop from current position to the starting point of widget | |
return path; | |
} | |
@override | |
bool shouldReclip(CustomClipper<Path> oldClipper) { | |
// TODO: implement shouldReclip | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment