Schwusch / widget_arrows

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

Fix 'Bad state: No element' - Empty Path Metrics #18

Closed HSCOGT closed 1 year ago

HSCOGT commented 1 year ago

I ran into the problem of 'computeMetrics' returning an empty list, getting the error 'Bad state: No element' because the code uses 'first' and 'last' getters, therefore I was getting a grey screen in a production build.

Quick fix, to validate if the list is not empty, it probably requires some analysis as to why 'computeMetrics' is not returning any values.

Schwusch commented 1 year ago

Thanks for the PR! It would be nice to know why the metrics are empty, but it's not good with a grey screen either :) Just a few nits, looks good otherwise

HSCOGT commented 1 year ago

Hi @Schwusch, thanks for taking a look, comments have been addressed and pushed.

Schwusch commented 1 year ago

Perfect! I'll push a release as soon as possible

Schwusch commented 1 year ago

Pushed to Pub: https://pub.dev/packages/widget_arrows/versions/0.6.0