AbdullahChauhan / custom-dropdown

Custom dropdown widget allows to add highly customizable dropdown widget in your projects. Features includes Search on list data, Network search, Multi-selection and many more.
https://pub.dev/packages/animated_custom_dropdown
BSD 3-Clause "New" or "Revised" License
158 stars 73 forks source link

why do we need to assert that `items` is not empty? #64

Closed hbatalhaStch closed 6 months ago

hbatalhaStch commented 8 months ago

In all constructors there is this assertion:

assert(items!.isNotEmpty, 'Items list must contain at least one item.',),

My question is: why do we do need this? I have a case where the items come from the database and there is a high chance it might be empty so my code will be throwing whenever it returns an empty list from the database.

AbdullahChauhan commented 6 months ago

Hi @hbatalhaStch This assertion removed in latest release 3.1.0. Thanks to you 😀