getClip method

  1. @override
Path getClip(
  1. Size size
)
override

Returns a description of the clip given that the render object being clipped is of the given size.

Implementation

@override
Path getClip(Size size) {
  Paint paint = Paint();
  paint.color = Colors.white;

  final width = size.width;
  final height = size.height;

  Path path = Path();
  path.moveTo(0, 0);
  path.quadraticBezierTo(0, 8, 10, 16);
  path.quadraticBezierTo(width - 1, height / 2 - 20, width, height / 2);
  path.quadraticBezierTo(width + 1, height / 2 + 20, 10, height - 16);
  path.quadraticBezierTo(0, height - 8, 0, height);
  path.close();

  return path;
}