view.dart 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vnoteapp/components/button.dart';
  4. import 'package:vnoteapp/components/side_nav/defines.dart';
  5. import 'package:vnoteapp/components/side_nav/side_nav.dart';
  6. import 'package:vnoteapp/pages/patient/create/controller.dart';
  7. import 'package:vnoteapp/pages/patient/create/widgets/area.dart';
  8. import 'package:vnoteapp/pages/patient/create/widgets/crowd_label.dart';
  9. import 'package:vnoteapp/pages/patient/create/widgets/patient_info.dart';
  10. class CreatePatientPage extends GetView<CreatePatientController> {
  11. const CreatePatientPage({super.key});
  12. @override
  13. Widget build(BuildContext context) {
  14. return Stack(
  15. children: [
  16. VSideNavView(
  17. // navId: NavIds.CREATE,
  18. items: _buildItems(),
  19. ),
  20. Positioned(
  21. bottom: 8,
  22. left: 200,
  23. right: 200,
  24. child: Row(
  25. mainAxisAlignment: MainAxisAlignment.spaceAround,
  26. children: [
  27. VButton(
  28. label: "下一步",
  29. onTap: () {
  30. controller.gotoSignContract();
  31. },
  32. ),
  33. VButton(
  34. label: "存为档案",
  35. onTap: () {
  36. controller.gotoPatientDetail();
  37. },
  38. ),
  39. ],
  40. ),
  41. ),
  42. ],
  43. );
  44. }
  45. List<VSideNavMenuItem> _buildItems() {
  46. final items = <VSideNavMenuItem>[];
  47. items.add(_buildSignatureItem());
  48. items.add(_buildAboutItem());
  49. items.add(_buildLogOutItem());
  50. return items;
  51. }
  52. VSideNavMenuItem _buildSignatureItem() {
  53. return VSideNavMenuItem(
  54. title: "签约信息",
  55. icon: Icon(Icons.edit_document, color: Colors.grey.shade700),
  56. // onTap: () {}
  57. pageBuilder: (_) => const Area(),
  58. // route: VRouteSetting(
  59. // "/area_panel",
  60. // () => const Area(),
  61. // binding: BindingsBuilder(
  62. // () {
  63. // Get.lazyPut(() => CreatePatientController());
  64. // },
  65. // ),
  66. // ),
  67. );
  68. }
  69. VSideNavMenuItem _buildAboutItem() {
  70. return VSideNavMenuItem(
  71. title: "人群分类",
  72. isRequired: true,
  73. icon: Icon(Icons.info_outline, color: Colors.grey.shade700),
  74. pageBuilder: (_) => const CrowdLabelView(),
  75. // route: VRouteSetting(
  76. // "/crowd_label_panel",
  77. // () => const CrowdLabelView(),
  78. // binding: BindingsBuilder(
  79. // () {
  80. // Get.lazyPut(() => CrowdLabelsController());
  81. // Get.lazyPut(() => CreatePatientController());
  82. // },
  83. // ),
  84. // ),
  85. // route: VRouteSetting("/about", () => const AboutPage()),
  86. );
  87. }
  88. VSideNavMenuItem _buildLogOutItem() {
  89. return VSideNavMenuItem(
  90. title: "个人信息",
  91. icon: Icon(Icons.exit_to_app, color: Colors.grey.shade700),
  92. pageBuilder: (_) => const PatientInfo(),
  93. // route: VRouteSetting(
  94. // "/patient_info_panel",
  95. // () => const PatientInfo(),
  96. // binding: BindingsBuilder(
  97. // () {
  98. // Get.lazyPut(() => CreatePatientController());
  99. // },
  100. // ),
  101. // ),
  102. // shouldRearrage: true, // TODO: 调整样式后启用
  103. );
  104. }
  105. }