Closed virdosdo closed 2 months ago
i's not a bug, it's just a way to force users to specify their model DropdownSearch<MyModel>
or DropdownSearch<MyModel>.multiSelection
if they uses custom models
compareFn
is important (required
) in case you are used custom model (not primitive type) it defines how compare two object of type your model.
Excelent! I solved it with: compareFn: (item1, item2) => item1.id == item2.id Sorry for the inconvenience, I didn't know that the compareFn statement was required. Thank you so much
Describe the bug Exception has occurred. _AssertionError ('package:dropdown_search/dropdown_search.dart': Failed assertion: line 188 pos 16: 'T == String || T == int || T == double || compareFn != null': is not true.)
To Reproduce On loading the form with the DropdownSearch widget
Expected behavior The search dropdown display with the elements
Screenshots Attached screen
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context I use a special model, with id and name structure for items. This worked fine before the package update to 6.0.0.