shape static method

SingleChildModifier shape({
  1. Key? key,
  2. required ShapeBorder shape,
  3. Clip clipBehavior = Clip.antiAlias,
})

Creates a shape clip.

Uses a ShapeBorderClipper to configure the ClipPath to clip to the given ShapeBorder.

Implementation

static SingleChildModifier shape({
  Key? key,
  required ShapeBorder shape,
  Clip clipBehavior = Clip.antiAlias,
}) {
  return BuilderModifier(
    key: key,
    builder: (BuildContext context, Widget? child) {
      return ClipPath(
        clipper: ShapeBorderClipper(
          shape: shape,
          textDirection: Directionality.maybeOf(context),
        ),
        clipBehavior: clipBehavior,
        child: child,
      );
    },
  );
}