ajilo297 / Flutter-Dotted-Border

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

Setting dashPattern: [0,0] or [0] crashes hot reload, and requires restart of simulator + Android Studio #4

Closed andreasmpet closed 4 years ago

andreasmpet commented 4 years ago

In an attempt to use the same widget for a solid border and dashed border, I stumbled into a weird bug where setting dashPattern to [0,0] or [0] brings down the whole iOS simulator + Android studio. For anything to work again, I have to restart both the simulator and Android studio.

I haven't tried much with other devices, but I assume something similar will happen.

I have a widget where I want the border to be dotted in one state, but solid in another. Is there a safe way of setting a non-dashed border other than using a different widget altogether?

ajilo297 commented 4 years ago

I have now added a check to make sure that the dashPattern property is considered invalid if it is an array of zeroes.

As an aside, to get a solid border, you should use a dashPattern as [a, 0] where a > 0.

Closing this issue, as I think this resolves that specific problem.