Flutter – while using (dotted border package) unable to round the border (radius values are not working)

even after changing the radius value border still remains the same

Widget AddTask() {
  return DottedBorder(
      borderType: BorderType.Rect,
      radius: const Radius.circular(30),
      dashPattern: const [10, 10],
      color: Colors.grey,
      strokeWidth: 2,
      child: const Center(
        child: Text(
          "+ Add",
          style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),

>Solution :

Use borderType: BorderType.RRect, instead of borderType: BorderType.Rect, please note Rect has an R prefix. R stands for rounded.

Leave a Reply