area.dart 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vnoteapp/architecture/types/kv.dart';
  4. import 'package:vnoteapp/components/cell.dart';
  5. import 'package:vnoteapp/components/dialog_select.dart';
  6. import 'package:vnoteapp/pages/patient/create/controller.dart';
  7. class Area extends GetView<CreatePatientController> {
  8. const Area({super.key});
  9. @override
  10. Widget build(BuildContext context) {
  11. return Column(
  12. children: [
  13. VListFormCellGroup(
  14. children: [
  15. VListFormCell(
  16. label: "签约机构",
  17. content: controller.state.organizationName,
  18. ),
  19. Obx(
  20. () {
  21. return VListFormCell(
  22. label: "签约区域",
  23. content: controller.state.villageName,
  24. onTap: () async {
  25. final result = await VDialogSelect<StringKVModel, String>(
  26. title: "选择签约区域",
  27. source: controller.state.villageOptions,
  28. valueGetter: (data) => data.key,
  29. labelGetter: (data) => data.value,
  30. initialValue: controller.state.villageCode,
  31. ).show();
  32. if (result != null) {
  33. controller.state.villageCode = result;
  34. }
  35. },
  36. );
  37. },
  38. ),
  39. ],
  40. ),
  41. ],
  42. );
  43. }
  44. }