Bdaya-Dev / circular-widgets

Display widgets in a circle.
BSD 2-Clause "Simplified" License
9 stars 2 forks source link

Don't get into itemBuilder if itemsLength == 0 #7

Closed baptistesx closed 1 year ago

baptistesx commented 1 year ago

It breaks when itemsLength == 0, because it goes into itemBuilder, and then try to access index which doesn't exist...

image
ahmednfwela commented 1 year ago

This isn't a problem in the package, since it's safely guarded here https://github.com/Bdaya-Dev/circular-widgets/blob/master/lib/src/circular_widgets.dart#L31

I think the problem is in your code, you have to rebuild the CircularWidgets widget when the length changes (using Provider or StreamBuilder for example)