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) {
  double sh = size.height;
  double sw = size.width;
  double cornerSide = sh * 0.1;

  Path path = Path()
    ..moveTo(cornerSide, 0)
    ..quadraticBezierTo(0, 0, 0, cornerSide)
    ..moveTo(0, sh - cornerSide)
    ..quadraticBezierTo(0, sh, cornerSide, sh)
    ..moveTo(sw - cornerSide, sh)
    ..quadraticBezierTo(sw, sh, sw, sh - cornerSide)
    ..moveTo(sw, cornerSide)
    ..quadraticBezierTo(sw, 0, sw - cornerSide, 0);
  return path;
}