shape method Null safety
- {Key? key,
- required ShapeBorder shape,
- Clip clipBehavior = Clip.antiAlias,
- Widget? child}
Creates a shape clip.
Uses a ShapeBorderClipper to configure the ClipPath to clip to the given ShapeBorder.
Implementation
static Widget shape({
Key? key,
required ShapeBorder shape,
Clip clipBehavior = Clip.antiAlias,
Widget? child,
}) {
assert(clipBehavior != null);
assert(shape != null);
return Builder(
key: key,
builder: (BuildContext context) {
return ClipPath(
clipper: ShapeBorderClipper(
shape: shape,
textDirection: Directionality.maybeOf(context),
),
clipBehavior: clipBehavior,
child: child,
);
},
);
}