CutCornerShape class

A shape that creates rectangles with cut (beveled) corners instead of rounded corners.

CutCornerShape generates geometric paths for rectangular shapes where the corners are "cut off" at an angle, creating a beveled appearance rather than curved corners. This creates a modern, geometric look that's different from traditional rounded rectangles.

The corner cuts are controlled by a BorderRadius parameter, where the radius values determine how much of each corner is cut off. Unlike rounded corners, these cuts create straight diagonal lines at each corner.

Example usage:

// Create a rectangle with all corners cut equally
CutCornerShape(
  borderRadius: BorderRadius.all(Radius.circular(12.0)),
)

// Create a rectangle with asymmetric corner cuts
CutCornerShape(
  borderRadius: BorderRadius.only(
    topLeft: Radius.circular(20.0),
    bottomRight: Radius.circular(15.0),
  ),
)
Inheritance

Constructors

CutCornerShape.new({BorderRadius? borderRadius})
Creates a new CutCornerShape with optional corner cuts.

Properties

borderRadius BorderRadius?
The border radius that defines how much of each corner should be cut.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build({Rect? rect, double? scale}) Path
Builds the geometric path for this cut corner shape.
override
generatePath({required Rect rect}) Path
Generates the actual path for the cut corner shape.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited