1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import 'package:fis_jsonrpc/rpc.dart';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:vitalapp/architecture/utils/datetime.dart';
- import 'package:vitalapp/components/alert_dialog.dart';
- import 'package:vitalapp/consts/rpc_enum_labels.dart';
- class FaceResultDialog extends StatelessWidget {
- final PatientBaseDTO data;
- /// 是否已建档
- final bool? hasCreateRecord;
- const FaceResultDialog({
- super.key,
- required this.data,
- this.hasCreateRecord = true,
- });
- static Future<bool> show(
- PatientBaseDTO data,
- bool hasCreateRecord,
- ) async {
- final result = await Get.dialog(
- FaceResultDialog(
- data: data,
- hasCreateRecord: hasCreateRecord,
- ),
- barrierDismissible: false,
- );
- return result == true;
- }
- @override
- Widget build(BuildContext context) {
- return _buildContent();
- }
- Widget _buildContent() {
- final title = hasCreateRecord! ? "识别结果-已建档" : "识别结果-未建档";
- return VAlertDialog(
- title: title,
- width: 400,
- contentPadding: const EdgeInsets.symmetric(horizontal: 36, vertical: 12),
- showCancel: false, // 目前销售确认只要确定,不需要取消
- onConfirm: () {
- Get.back(result: true);
- },
- content: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- _buildRow("姓名", data.patientName!),
- _buildRow("性别", RpcEnumLabels.gender[data.patientGender]!),
- _buildRow("年龄", DataTimeUtils.calculateAge(data.birthday!)),
- _buildRow("身份证", data.cardNo!),
- if (hasCreateRecord!) _buildRow("建档机构", data.createdOrgName ?? ''),
- if (hasCreateRecord!) _buildRow("建档医生", data.createdDoctorName ?? ''),
- ],
- ),
- );
- }
- Widget _buildRow(String label, String content) {
- return Padding(
- padding: const EdgeInsets.symmetric(vertical: 4),
- child: Row(
- children: [
- SizedBox(
- width: 90,
- child: Text(
- '$label:',
- style: const TextStyle(color: Colors.black, fontSize: 20),
- ),
- ),
- const SizedBox(width: 12),
- Expanded(
- child: Text(
- content,
- style: const TextStyle(color: Colors.black, fontSize: 20),
- ),
- ),
- ],
- ),
- );
- }
- }
|