1 原生

原生的下拉框非常简陋
image.pngimage.png

  1. final _value = 1.obs;
  2. Obx(() => DropdownButton(
  3. items: [
  4. DropdownMenuItem(child: Text("111"), value: 1),
  5. DropdownMenuItem(child: Text("222"), value: 2),
  6. DropdownMenuItem(child: Text("333"), value: 3),
  7. DropdownMenuItem(child: Text("444"), value: 4),
  8. ],
  9. value: _value.value,
  10. onChanged: (value) {
  11. _value.value = value as int;
  12. })),