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) {
  final path = Path()
    ..moveTo(size.width, 0) // Start at the top-right corner
    ..lineTo(0, size.height) // Draw to the bottom-left corner
    ..lineTo(size.width, size.height) // Draw to the bottom-right corner
    ..close(); // Close the path
  return path;
}