diff --git a/lib/features/lab/models/resp_models/lab_result.dart b/lib/features/lab/models/resp_models/lab_result.dart index b00420c7..ebfcab07 100644 --- a/lib/features/lab/models/resp_models/lab_result.dart +++ b/lib/features/lab/models/resp_models/lab_result.dart @@ -56,6 +56,7 @@ class LabResult { List? fileNameWithExtensionList; String? verifiedOn; dynamic verifiedOnDateTime; + bool? isPackage; LabResult( {this.accessionNo, @@ -187,6 +188,8 @@ class LabResult { verifiedOn = json['VerifiedOn']; verifiedOnDateTime = json['VerifiedOnDateTime']; + + isPackage = json['IsPackage']; } Map toJson() { diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart index 38c228a7..bc1b1e07 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart @@ -1,11 +1,13 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; import 'package:hmg_patient_app_new/features/lab/models/resp_models/lab_result.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; +import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/date_range_selector/viewmodel/date_range_view_model.dart'; import 'package:provider/provider.dart'; import '../../../core/utils/size_utils.dart' show ResponsiveExtension; @@ -87,7 +89,24 @@ class _LabResultListState extends State { }, ) else - SizedBox.shrink() + SizedBox.shrink(), + CustomButton( + icon: AppAssets.document, + iconColor: AppColors.primaryRedColor, + iconSize: 16.h, + text: LocaleKeys.viewAttachment.tr(context: context), + onPressed: () async { + model.openLabResultsAttachmentSheet(labResult: labResults.first); + }, + backgroundColor: AppColors.primaryRedColor.withAlpha(20), + borderColor: AppColors.primaryRedColor.withAlpha(0), + textColor: AppColors.primaryRedColor, + fontSize: 13.f, + fontWeight: FontWeight.w600, + borderRadius: 12.r, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 40.h, + ), ], ),), diff --git a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart index d3de245c..4bbb1a20 100644 --- a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart +++ b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart @@ -162,7 +162,7 @@ class LabOrderResultItem extends StatelessWidget { ), ), ), - if (tests?.isLabTestAttachment ?? false) + if ((tests?.isLabTestAttachment ?? false) && !(tests?.isPackage ?? false)) Flexible( flex: 2, child: CustomButton(