If items in the list is changed then it throw error
There should be exactly one item with [DropdownButtonFormField]'s value: ... Either zero or 2 or more [DropdownMenuItem]s were detected with the same value 'package:dropdown_button2/src/dropdown_button2.dart': Failed assertion: line 1045 pos 11: 'items == null ||
the items list has unique value but the items list change and want to reset the value to empty values
Can you provide a minimal reproducible sample?
Added code in blow git directory
https://github.com/kkhura/drop_down/tree/main
I need to clear previous value to blank or null not work because of below code
items == null || items.isEmpty || value == null || items.where((DropdownMenuItem<T> item) { return item.value == value; }).length == 1, "There should be exactly one item with [DropdownButtonFormField]'s value: " '$value. \n' 'Either zero or 2 or more [DropdownMenuItem]s were detected ' 'with the same value', ),
Can you make a minimal sample, please?
You can start with Simple DropdownButton2 with no styling sample at ReadMe and update it to reproduce the issue.
Also, which version of the package you're using?