icemanbsi / searchable_dropdown

MIT License
107 stars 162 forks source link

Search is not working when i use value as Id inside onChanged #131

Open muralikrishnanmt opened 3 years ago

muralikrishnanmt commented 3 years ago

Searching is not working when i use the value as the id. Here is the code

Center(
            child: SearchableDropdown.single(
              isExpanded: true,
              value: selectedDistcrictID,
              hint: "Select one",
              searchHint: "Select one",
              items: data.map(
                (list) {
                  return DropdownMenuItem(
                    child: Text(list['district]),
                    value: `list['districtID'],`
                  );
                },
              ).toList(),
              onChanged: (value) {
                setState(() {
                  selectedDistcrictID = value;
                  print(selectedDistcrictID);
                });
              },
            ),
          ),