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) {
  var path = Path();

  if (type == BubbleType.sendBubble) {
    path.addRRect(RRect.fromLTRBR(
        0, 0, size.width, size.height, Radius.circular(radius)));
    var path2 = Path();
    path2.addRRect(RRect.fromLTRBAndCorners(0, 0, radius, radius,
        bottomRight: Radius.circular(secondRadius)));
    path.addPath(path2, Offset(size.width - radius, size.height - radius));
  } else {
    path.addRRect(RRect.fromLTRBR(
        0, 0, size.width, size.height, Radius.circular(radius)));
    var path2 = Path();
    path2.addRRect(RRect.fromLTRBAndCorners(0, 0, radius, radius,
        topLeft: Radius.circular(secondRadius)));
    path.addPath(path2, Offset(0, 0));
  }

  return path;
}