Schwusch / widget_arrows

Draw arrows between widgets in Flutter
https://pub.dev/packages/widget_arrows
MIT License
145 stars 14 forks source link

Adds ability to target multiple ArrowElements from a single source #10

Closed latesr closed 3 years ago

latesr commented 3 years ago

Hi,

I needed a way to target multiple destinations from a single source, so I added the ability to specify a list of targetIds. I've done this in a source compatible way, however, it's possible to simplify the code if you're willing to make a small compatibility break. Specifically, if ArrowElement had a non-const constructor, it would be possible to populate the targetIds list from a single targetId. However, as that would break source compatibility, I check for this in the paint override.

I've also updated the example to demonstrate multiple targets whilst leaving most of the destinations as single targets.

I've finally created the flutter project in the example folder so it compiles/runs out of the box. That's what I've seen most packages do, but if that's not correct it can be changed.

Very happy for feedback or further suggestions.

Best regards,

Keith

Schwusch commented 3 years ago

Exemplary PR! A lot of people have asked for this feature, so it is very welcome. I'll make a new release as soon as I can.

Schwusch commented 3 years ago

Published as 0.1.8 https://pub.dev/packages/widget_arrows/versions/0.1.8