How could I make the selected item from the dropdownButton to store the current selected min and max value of the json in to minTip and maxTip.
A small sample of my code below:
String minTip;
String maxTip;
String _mySelection;
List<Map> _myJson = [
{"id": "1", "name": "Restaurant", "min": "10", "max": "20"},
{"id": "2", "name": "Delivery", "min": "5", "max": "15"}
];
DropdownButton<String>(
value: _mySelection,
style: TextStyle(color: Colors.orange),
onChanged: (String newValue) {
setState(() {
_mySelection = newValue;
});
},
items: _myJson.map((Map map) {
return DropdownMenuItem<String>(
child: new Text(map["name"]),
value: map["id"].toString(),
);
}).toList(),
),