address.dart 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vitalapp/components/cell.dart';
  4. import 'package:vitalapp/components/dialog_input.dart';
  5. import 'package:vitalapp/pages/patient/create/controller.dart';
  6. class Address extends GetView<CreatePatientController> {
  7. const Address({super.key});
  8. @override
  9. Widget build(BuildContext context) {
  10. return Column(
  11. children: [
  12. VListFormCellGroup(
  13. children: [
  14. VListFormCell(
  15. label: "同步户籍地址到现住地址",
  16. labelWidth: 250,
  17. contentWidget: Container(
  18. child: Obx(
  19. () => Switch(
  20. onChanged: (value) {
  21. controller.onSyncAddressCheckChanged(value);
  22. },
  23. value: controller.patientInfomationState.isSyncAddresses,
  24. ),
  25. ),
  26. ),
  27. ),
  28. Obx(
  29. () => VListFormCell(
  30. label: "户籍地址",
  31. content:
  32. controller.patientInfomationState.permanentResidenceAddress,
  33. onTap: () async {
  34. final result = await VDialogInput(
  35. title: "户籍地址",
  36. initialValue: controller
  37. .patientInfomationState.permanentResidenceAddress,
  38. placeholder: "请填写户籍地址",
  39. ).show();
  40. if (result != null) {
  41. controller.onCensusRegisterChanged(result);
  42. }
  43. },
  44. ),
  45. ),
  46. Obx(
  47. () => VListFormCell(
  48. label: "现住地址",
  49. content: controller.patientInfomationState.address,
  50. onTap: () async {
  51. final result = await VDialogInput(
  52. title: "现住地址",
  53. initialValue: controller.patientInfomationState.address,
  54. placeholder: "请填写现住地址",
  55. ).show();
  56. if (result != null) {
  57. controller.patientInfomationState.address = result;
  58. }
  59. },
  60. ),
  61. ),
  62. ],
  63. ),
  64. ],
  65. );
  66. }
  67. }