withRoundCorners method

Container withRoundCorners({
  1. required Color backgroundColor,
  2. double? radius,
})

Add round corners to a Container if the Container already has a color use backgroundColor instead and remove the Color from the Container it self

Implementation

Container withRoundCorners({required Color backgroundColor, double? radius}) => Container(
      decoration: BoxDecoration(
        color: backgroundColor,
        borderRadius: BorderRadius.all(
          Radius.circular(radius ?? 25),
        ),
      ),
      child: this,
    );