I have a problem regardin a searchable dropdown widget.
When I try to change the setState() in the app, it doesn't work. So when I click another element, for example: PlatformReach('Jud Braila', '(RO, [Braila] County)'). The state of the widget remains the same.
I looked in the documentation for the dropdown searchable widget, and I don't see any difference regarding setting the state. Here is the link:
I have a problem regardin a searchable dropdown widget.
When I try to change the setState() in the app, it doesn't work. So when I click another element, for example: PlatformReach('Jud Braila', '(RO, [Braila] County)'). The state of the widget remains the same.
I looked in the documentation for the dropdown searchable widget, and I don't see any difference regarding setting the state. Here is the link:
https://pub.dev/packages/searchable_dropdown/example
List _platformReach = PlatformReach.getPlatformReach(); List _dropdownPlatformReach;
PlatformReach _selectedPlatformReach;
void initState() { _dropdownMenuItems = buildDropDownMenuItems(_visibility); _selectedVisibility = _dropdownMenuItems[0].value;
_dropdownPlatformReach = buildDropdownMenuItemsPlatformReach(_platformReach); _selectedPlatformReach = _dropdownPlatformReach[0].value;
super.initState(); }
List buildDropdownMenuItemsPlatformReach(
List platforms) {
List items = List();
for (PlatformReach platform in platforms) {
items.add(
DropdownMenuItem(
value: platform,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
platform.name,
style: TextStyle(fontWeight: FontWeight.bold),
textAlign: TextAlign.start,
),
Text(
platform.hint,
style: TextStyle(
fontWeight: FontWeight.normal, color: Colors.grey),
textAlign: TextAlign.end,
)
],
),
),
);
}
return items;
}
Expanded(
class PlatformReach { String name; String hint;
PlatformReach(this.name, this.hint);
static List getPlatformReach() { return [ PlatformReach('Jud Galati', '(RO, [Galati] County)'), PlatformReach('Jud Braila', '(RO, [Braila] County)'), PlatformReach('Jud Prahova', '(RO, [Ploiesti] County)'), PlatformReach('Jud Maramures', '(RO, [Baia Mare] County)'), ]; } }