📅  最后修改于: 2022-03-11 14:48:02.102000             🧑  作者: Mango
enum ClassType {A, B, C, D}
return DropdownButton(
value: classType,
onChanged: (ClassType newValue) {
setState(() {
viewModel.classType = newValue;
});
},
items: ClassType.values.map((ClassType classType) {
return DropdownMenuItem(
value: classType,
child: Text(classType.toString()));
}).toList();
);