functions_panel.dart 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vitalapp/consts/styles.dart';
  4. import 'package:vitalapp/pages/widgets/function_button.dart';
  5. import '../controller.dart';
  6. /// 功能入口面板
  7. class FunctionsPanel extends GetView<PatientDetailController> {
  8. const FunctionsPanel({super.key});
  9. @override
  10. Widget build(BuildContext context) {
  11. return Container(
  12. alignment: Alignment.topLeft,
  13. margin: const EdgeInsets.all(8).copyWith(left: 0, right: 12),
  14. decoration: BoxDecoration(
  15. color: Colors.white,
  16. borderRadius: GlobalStyles.borderRadius,
  17. ),
  18. padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 10)
  19. .copyWith(right: 0),
  20. child: GridView(
  21. padding: const EdgeInsets.symmetric(horizontal: 32).copyWith(top: 12),
  22. // shrinkWrap: true,
  23. // controller: scrollController,
  24. gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
  25. crossAxisCount: 3,
  26. mainAxisSpacing: 24,
  27. crossAxisSpacing: 24,
  28. childAspectRatio: 15 / 14,
  29. ),
  30. children: [
  31. FunctionButton(
  32. label: "健康档案",
  33. icon: _buildImgIcon("档案.png"),
  34. onTap: controller.gotoInfo,
  35. ),
  36. // FunctionButton(
  37. // label: "体检记录",
  38. // icon: _buildImgIcon("体检记录.png"),
  39. // onTap: controller.gotoHealthCheckRecord,
  40. // ),
  41. // FunctionButton(
  42. // label: "随访记录",
  43. // icon: _buildImgIcon("随访报告.png"),
  44. // onTap: controller.gotoFollowUpRecord,
  45. // ),
  46. // FunctionButton(
  47. // label: "双向转诊",
  48. // icon: _buildImgIcon("转诊.png"),
  49. // onTap: controller.gotoReferral,
  50. // ),
  51. // FunctionButton(
  52. // label: "签约记录",
  53. // icon: _buildImgIcon("签约记录.png"),
  54. // onTap: controller.gotoContractRecords,
  55. // ),
  56. FunctionButton(
  57. label: "健康检测记录",
  58. icon: _buildImgIcon("诊疗.png"),
  59. onTap: controller.gotoExamRecord,
  60. ),
  61. ],
  62. ),
  63. );
  64. }
  65. Widget _buildImgIcon(String assetName) {
  66. return Image.asset(
  67. "assets/images/patient/$assetName",
  68. width: 120,
  69. height: 120,
  70. fit: BoxFit.contain,
  71. );
  72. }
  73. }