'Searchable Dropdown not changing the value when keyboard is open in flutter
In my flutter application I am using the following package for search in my dropdown : https://pub.dev/packages/searchable_dropdown
When I am using the dropdown in the simulator without the keyboard being popped up, it works as expected, but when I keep the keyboard open, the value in the dropdown does not get updated. It seems that on tap of the dropdown item, the keyboard gets dismissed and also the dropdown, but the value in the dropdown not get updated.
Following is the code:
SearchableDropdown.single(
items: snapshot.hasData
? _passportIssuingAuthorityBloc.countryname
.map<DropdownMenuItem<String>>(
(value) => DropdownMenuItem<String>(
value: value,
child: Padding(
padding: const EdgeInsets.only(
left: 26),
child: Text(value,
overflow:
TextOverflow.ellipsis),
)))
.toList()
: null,
underline: Container(),
value: dropdownsnapshot.data == ""
? ""
: dropdownsnapshot.data,
hint: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 22),
child: Text("Select Issuing Authority"),
),
searchHint: "Select Issuing Authority",
onChanged: (value) {
_passportissuingValue = value;
},
isExpanded: true,
);
Can someone please help me with this? If I have to use another widget in place of this widget to use the searchable dropdown, it would also be helpful.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
