selectedItemByValue static method
selected item by value from dropdown
Implementation
static DropdownItem? selectedItemByValue(
List<DropdownItem> list, String value) {
DropdownItem? selectedItem;
for (DropdownItem obj in list) {
if (DropdownItem._equals(value, obj.value)) {
selectedItem = obj;
break;
}
}
if (selectedItem == null && list.isNotEmpty) {
selectedItem = list[0];
}
return selectedItem;
}