rounded method

Widget rounded({
  1. double borderRadius = 16.0,
  2. Color? color,
  3. BoxFit fit = BoxFit.cover,
})

Implementation

Widget rounded({
  double borderRadius = 16.0, // Default border radius
  Color? color, // Optional color for the background
  BoxFit fit =
      BoxFit.cover, // Optional BoxFit to fit image properly in the shape
}) {
  return ClipRRect(
    borderRadius: BorderRadius.circular(borderRadius),
    child: Container(
      color: color ??
          Colors.transparent, // Use transparent color if not provided
      child: this,
    ),
  );
}