CouponClipper constructor
const
CouponClipper({})
Paints a coupon shape around any widget.
Usage:
ClipPath(
clipper: CouponClipper(
// optional (defaults to TextDirection.ltr), works when
// curveAxis set to Axis.vertical
direction: Directionality.of(context),
),
// width and height are important depending on the type
// of the text direction
child: Container(
width: 350,
height: 400,
color: Colors.purple,
),
),
Implementation
const CouponClipper({
this.borderRadius = 8,
this.curveRadius = 20,
this.curvePosition = 100,
this.curveAxis = Axis.horizontal,
this.direction = TextDirection.ltr,
this.clockwise = false,
}) : assert(
curvePosition > borderRadius,
"'curvePosition' should be greater than the 'borderRadius'",
);