address.dart 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vnoteapp/components/cell.dart';
  4. import 'package:vnoteapp/components/dialog_input.dart';
  5. import 'package:vnoteapp/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.state.isSyncAddresses,
  24. ),
  25. ),
  26. ),
  27. ),
  28. Obx(
  29. () => VListFormCell(
  30. label: "户籍地址",
  31. content: controller.state.censusRegister,
  32. onTap: () async {
  33. final result = await VDialogInput(
  34. title: "户籍地址",
  35. initialValue: controller.state.censusRegister,
  36. placeholder: "请填写户籍地址",
  37. ).show();
  38. if (result != null) {
  39. controller.onCensusRegisterChanged(result);
  40. }
  41. },
  42. ),
  43. ),
  44. Obx(
  45. () => VListFormCell(
  46. label: "现住地址",
  47. content: controller.state.address,
  48. onTap: () async {
  49. final result = await VDialogInput(
  50. title: "现住地址",
  51. initialValue: controller.state.address,
  52. placeholder: "请填写现住地址",
  53. ).show();
  54. if (result != null) {
  55. controller.state.address = result;
  56. }
  57. },
  58. ),
  59. ),
  60. ],
  61. ),
  62. ],
  63. );
  64. }
  65. }