clipRect method

Widget clipRect({
  1. CustomClipper<Rect>? clipper,
  2. Clip behavior = Clip.hardEdge,
})

A modifier that clips its widget to a rectangular shape.

Example:

Icon(Icons.person)
    .clipRect();

Implementation

Widget clipRect({
  CustomClipper<Rect>? clipper,
  Clip behavior: Clip.hardEdge,
}) {
  return ClipRect(child: this, clipper: clipper, clipBehavior: behavior);
}