Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_app/main.dart';
  3.  
  4. class CustomShapeClipper extends CustomClipper<Path> {
  5. @override
  6. Path getClip(Size size) {
  7. final Path path = Path();
  8. path.lineTo(0.0, size.height);
  9.  
  10.  
  11.  
  12. path.lineTo(0.0, size.height-40);
  13. path.quadraticBezierTo(size.width / 4, size.height, size.width / 2, size.height);
  14.  
  15. path.quadraticBezierTo(size.width - (size.width / 4), size.height, size.width, size.height - 40);
  16. path.lineTo(size.width, 0.0);
  17.  
  18.  
  19. path.lineTo(size.width, 0.0);
  20. path.close();
  21.  
  22.  
  23.  
  24. return path;
  25. }
  26.  
  27. @override
  28. bool shouldReclip(CustomClipper oldClipper) => true;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement