view.dart 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import 'package:flutter/material.dart';
  2. import 'package:get/get.dart';
  3. import 'package:vnoteapp/components/appbar.dart';
  4. import 'package:vnoteapp/pages/check/follow_up/widgets/follow_up_from.dart';
  5. import 'package:vnoteapp/pages/check/widgets/check_category_widget.dart';
  6. import 'package:vnoteapp/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: 50,
  30. vertical: 20,
  31. ),
  32. child: buildFollowUpList(),
  33. ),
  34. ),
  35. ),
  36. );
  37. }
  38. Widget buildFollowUpList() {
  39. return Wrap(
  40. spacing: 40,
  41. runSpacing: 40,
  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. Get.to(
  55. ConfigurableCard(
  56. cardKey: key,
  57. callBack: (key, templateCode, data) async {
  58. await controller.createFollowUp(key, templateCode, data);
  59. Get.back();
  60. },
  61. followUpWidget: const FollowUpFrom(),
  62. ),
  63. );
  64. }
  65. }