123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:vitalapp/architecture/utils/prompt_box.dart';
- import 'package:vitalapp/components/alert_dialog.dart';
- import 'package:vitalapp/components/button.dart';
- import 'package:vitalapp/pages/check/examination/controller.dart';
- import 'package:vitalapp/pages/check/widgets/check_category_widget.dart';
- import 'package:vitalapp/pages/check/widgets/configurable_card.dart';
- class ExaminationPage extends GetView<ExaminationController> {
- const ExaminationPage({Key? key}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: const Color.fromRGBO(238, 238, 238, 1),
- // appBar: VAppBar(
- // titleWidget: const Text('健康体检'),
- // ),
- body: Stack(
- children: [
- Scrollbar(
- thumbVisibility: true,
- child: SingleChildScrollView(
- child: Center(
- child: Container(
- padding: const EdgeInsets.symmetric(vertical: 20),
- child: buildExaminationList(),
- ),
- ),
- ),
- ),
- Positioned(
- right: 20,
- bottom: 50,
- child: SizedBox(
- width: 200,
- height: 70,
- child: VButton(
- label: '结束本轮体检',
- onTap: () async {
- final isExamEmpty = await controller.checkExamEmpty();
- if (isExamEmpty) {
- PromptBox.toast("不能提交空数据");
- } else {
- Get.dialog(VAlertDialog(
- title: '提示',
- content: Container(
- margin: const EdgeInsets.only(bottom: 20),
- child: const Text(
- '确定结束本次体检?',
- style: TextStyle(fontSize: 20),
- textAlign: TextAlign.center,
- ),
- ),
- showCancel: true,
- onConfirm: () {
- controller.deleteCached();
- },
- ));
- }
- },
- ),
- ),
- ),
- ],
- ),
- );
- }
- Widget buildExaminationList() {
- return Wrap(
- spacing: 26,
- runSpacing: 26,
- children: controller.menuList
- .map((e) => CheckCategoryWidget(
- label: e.label,
- assetName: "${e.label}.png",
- onTap: () {
- changePage(e.value);
- },
- ))
- .toList(),
- );
- }
- void changePage(String key) {
- Get.to(
- ConfigurableCard(
- cardKey: key,
- callBack: (key, templateCode, data) async {
- await controller.createOrUpdateExam(key, templateCode, data);
- return true;
- },
- patientCode: controller.patientCode,
- ),
- transition: Transition.rightToLeft,
- );
- }
- }
|