view.dart 3.6 KB

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