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}) {
  BorderRadius b = borderRadius ?? MoyeConfig.roundBorderRadius;
  Widget clipR = ClipRRect(
    borderRadius: b,
    child: this,
  );
  return border == null
      ? clipR
      : Container(
          child: clipR,
          decoration: BoxDecoration(border: border, borderRadius: b),
        );
}