view.dart 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import 'package:fis_jsonrpc/rpc.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:get/get.dart';
  4. import 'package:vitalapp/pages/check/follow_up/widgets/follow_up_from.dart';
  5. import 'package:vitalapp/pages/check/widgets/check_category_widget.dart';
  6. import 'package:vitalapp/pages/check/widgets/configurable_card.dart';
  7. import 'index.dart';
  8. class FollowUpPage extends GetView<FollowUpController> {
  9. const FollowUpPage({Key? key}) : super(key: key);
  10. @override
  11. Widget build(BuildContext context) {
  12. return GetBuilder<FollowUpController>(
  13. init: FollowUpController(),
  14. id: "examination",
  15. builder: (_) => buildFollowUpPage(),
  16. );
  17. }
  18. Widget buildFollowUpPage() {
  19. return Scaffold(
  20. backgroundColor: const Color.fromRGBO(238, 238, 238, 1),
  21. // appBar: VAppBar(
  22. // titleWidget: const Text('人群随访'),
  23. // ),
  24. body: Scrollbar(
  25. thumbVisibility: true,
  26. child: SingleChildScrollView(
  27. child: Container(
  28. padding: const EdgeInsets.symmetric(
  29. horizontal: 20,
  30. vertical: 20,
  31. ),
  32. child: buildFollowUpList(),
  33. ),
  34. ),
  35. ),
  36. );
  37. }
  38. Widget buildFollowUpList() {
  39. return Wrap(
  40. spacing: 26,
  41. runSpacing: 26,
  42. children: controller.menuList
  43. .map((e) => CheckCategoryWidget(
  44. label: e.label,
  45. assetName: "${e.label}.png",
  46. onTap: () {
  47. changePage(e.value);
  48. },
  49. ))
  50. .toList(),
  51. );
  52. }
  53. void changePage(String key) {
  54. controller.state.followUpTime = DateTime.now();
  55. controller.state.nextFollowUpTime = null;
  56. controller.state.followUpMode = FollowUpModeEnum.Outpatient;
  57. controller.state.followUpPhoto = '';
  58. Get.to(
  59. ConfigurableCard(
  60. cardKey: key,
  61. callBack: (key, templateCode, data, prescriptionKey) async {
  62. final result = await controller.createFollowUp(
  63. key,
  64. templateCode,
  65. data,
  66. prescriptionKey.toString(),
  67. );
  68. return result;
  69. },
  70. followUpWidget: FollowUpFrom(cardKey: key),
  71. ),
  72. transition: Transition.rightToLeft,
  73. );
  74. }
  75. }