ajilo297 / Flutter-Dotted-Border

A Flutter package to easily add dashed borders around widgets
https://pub.dev/packages/dotted_border
MIT License
295 stars 63 forks source link

radius does not work #25

Closed ChurikiTenna closed 1 year ago

ChurikiTenna commented 1 year ago

Describe the bug radius does not work.

To Reproduce Run code below

DottedBorder(
      color: Color.fromARGB(255, 134, 129, 129), // 点線の色
      radius: Radius.circular(12),
      dashPattern: [6.0,4.0],
      strokeWidth: 3.0,
      strokeCap: StrokeCap.round,
      child: ClipRRect(
        borderRadius: BorderRadius.all(Radius.circular(12)),
        child: child),
    )

Expected behavior Corner rounded

Screenshots IMG_4D5C44F26878-1

Desktop (please complete the following information):

Smartphone (please complete the following information):

ajilo297 commented 1 year ago

Thanks for raising the issue. I know this is not intuitive and I am trying to find some time to fix it.

BorderRadius will affect the border type only if the borderType is of type BorderType.RRect.

So your code would become something like this

DottedBorder(
  color: const Color.fromARGB(255, 134, 129, 129),
  borderType: BorderType.RRect, // <- You need this
  radius: const Radius.circular(12),
  dashPattern: const [6.0, 4.0],
  strokeWidth: 3.0,
  strokeCap: StrokeCap.round,
  child: ClipRRect(
    borderRadius:
        const BorderRadius.all(Radius.circular(12)),
    child: child,
  ),
)