Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.99 KB | None | 0 0
  1. class TopFeedsWaveCurve extends CustomClipper<Path> {
  2.   TopFeedsWaveCurve();
  3.   final double halfInnerWidth = innerWidth / 2;
  4.   final double _heightCurve = 40.0;
  5.   final double _barHeight = 20.0;
  6.   @override
  7.   Path getClip(Size size) {
  8.     var path = Path();
  9.     path.moveTo(0.0, 0.0);
  10.     path.lineTo(0.0, _barHeight);
  11.     path.lineTo(size.width / 2 - halfInnerWidth - _barHeight, _barHeight);
  12.  
  13.     path.cubicTo(size.width / 2 - halfInnerWidth, _barHeight, size.width / 2 - halfInnerWidth, _heightCurve, size.width / 2 - halfInnerWidth + _barHeight,
  14.       _heightCurve,);
  15.     path.lineTo(size.width / 2 + halfInnerWidth -_barHeight, _heightCurve);
  16.     path.cubicTo(size.width / 2 + halfInnerWidth , _heightCurve , size.width / 2 + halfInnerWidth, _barHeight, size.width / 2 + halfInnerWidth +
  17.         _barHeight,15,);
  18.  
  19.     path.lineTo(size.width, _barHeight);
  20.     path.lineTo(size.width, 0);
  21.  
  22.     return path;
  23.   }
  24.  
  25.   @override
  26.   bool shouldReclip(CustomClipper<Path> oldClipper) => true;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement