I want to achieve different values behind the scene, for example, if the user selects "United State of America" behind the scene I want a value "USA" only. How can I achieve this?
Here is my button:
DropdownButton<String>(
isExpanded: true,
underline: SizedBox(),
icon: SvgPicture.asset("assets/icons/dropdown.svg"),
value: dropdownValue,
items: [
'Nepal',
'India',
'United States',
'Denmark',
'UK',
'World Wide'
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
});
},
),