int _value = 0;
Widget _buildDropdown() {
return DropdownButton(
value: _value,
items: [
DropdownMenuItem(
value: 0,
child: Container(
color: Colors.blue, // you need this
child: Text("Zero"),
width: 100,
alignment: Alignment.center,
),
),
DropdownMenuItem(
value: 1,
child: Container(
color: Colors.green, // you need this
child: Text("One"),
width: 100,
alignment: Alignment.center,
),
),
],
onChanged: (value) => setState(() => _value = value),
);
}