withRoundCorners method

Widget withRoundCorners({
  1. BoxBorder? border,
  2. BorderRadius? borderRadius,
})

Makes this widget have round corners. You could also specify border

Implementation

Widget withRoundCorners({BoxBorder? border, BorderRadius? borderRadius}) {
  Widget clipR = ClipRRect(
    borderRadius: borderRadius ?? BorderRadius.zero,
    child: this,
  );
  return border == null
      ? clipR
      : Container(
          child: clipR,
          decoration:
              BoxDecoration(border: border, borderRadius: borderRadius),
        );
}