|  |  | @ -4,9 +4,11 @@ import 'package:flutter/material.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; |  |  |  | import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/app_assets.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/app_assets.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/core/utils/utils.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/extensions/string_extensions.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/extensions/widget_extensions.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; |  |  |  | import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; |  |  |  | import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart'; |  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_hospital/LabResultList.dart'; |  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_hospital/LabResultList.dart'; | 
			
		
	
	
		
		
			
				
					|  |  | @ -14,12 +16,20 @@ import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_hospital/lab | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/theme/colors.dart'; |  |  |  | import 'package:hmg_patient_app_new/theme/colors.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; |  |  |  | import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; |  |  |  | import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; |  |  |  | import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:open_filex/open_filex.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:provider/provider.dart'; |  |  |  | import 'package:provider/provider.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | class LabResultByHospitals extends StatelessWidget { |  |  |  | class LabResultByHospitals extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   LabResultByHospitals({required this.labOrder, Key? key}); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   late LabViewModel labViewModel; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   PatientLabOrdersResponseModel labOrder; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   @override |  |  |  |   @override | 
			
		
	
		
		
			
				
					
					|  |  |  |   Widget build(BuildContext context) { |  |  |  |   Widget build(BuildContext context) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     labViewModel = Provider.of<LabViewModel>(context, listen: false); | 
			
		
	
		
		
			
				
					
					|  |  |  |     return Scaffold( |  |  |  |     return Scaffold( | 
			
		
	
		
		
			
				
					
					|  |  |  |       backgroundColor: AppColors.bgScaffoldColor, |  |  |  |       backgroundColor: AppColors.bgScaffoldColor, | 
			
		
	
		
		
			
				
					
					|  |  |  |       body: Column( |  |  |  |       body: Column( | 
			
		
	
	
		
		
			
				
					|  |  | @ -83,33 +93,37 @@ class LabResultByHospitals extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |             child: CustomButton( |  |  |  |             child: CustomButton( | 
			
		
	
		
		
			
				
					
					|  |  |  |               text: "Download report".needTranslation, |  |  |  |               text: "Download report".needTranslation, | 
			
		
	
		
		
			
				
					
					|  |  |  |               onPressed: () async { |  |  |  |               onPressed: () async { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 // LoaderBottomSheet.showLoader(); |  |  |  |                 LoaderBottomSheet.showLoader(loadingText: "Generating report, Please wait...".needTranslation); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 // await radiologyViewModel.getRadiologyPDF(patientRadiologyResponseModel: widget.patientRadiologyResponseModel, authenticatedUser: _appState.getAuthenticatedUser()!, onError: (err) { |  |  |  |                 await labViewModel | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //   LoaderBottomSheet.hideLoader(); |  |  |  |                     .getLabResultReportPDF( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //   showCommonBottomSheetWithoutHeight( |  |  |  |                         labOrder: labOrder, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     context, |  |  |  |                         onError: (err) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     child: Utils.getErrorWidget(loadingText: err), |  |  |  |                           LoaderBottomSheet.hideLoader(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     callBackFunc: () {}, |  |  |  |                           showCommonBottomSheetWithoutHeight( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     isFullScreen: false, |  |  |  |                             context, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     isCloseButtonVisible: true, |  |  |  |                             child: Utils.getErrorWidget(loadingText: err), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //   ); |  |  |  |                             callBackFunc: () {}, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 // }).then((val) async { |  |  |  |                             isFullScreen: false, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //   LoaderBottomSheet.hideLoader(); |  |  |  |                             isCloseButtonVisible: true, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //   if (radiologyViewModel.patientRadiologyReportPDFBase64.isNotEmpty) { |  |  |  |                           ); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     String path = await Utils.createFileFromString(radiologyViewModel.patientRadiologyReportPDFBase64, "pdf"); |  |  |  |                         }) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     try { |  |  |  |                     .then((val) async { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //       OpenFilex.open(path); |  |  |  |                   LoaderBottomSheet.hideLoader(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     } catch (ex) { |  |  |  |                   if (labViewModel.patientLabResultReportPDFBase64.isNotEmpty) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //       showCommonBottomSheetWithoutHeight( |  |  |  |                     String path = await Utils.createFileFromString(labViewModel.patientLabResultReportPDFBase64, "pdf"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //         context, |  |  |  |                     try { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //         child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation), |  |  |  |                       OpenFilex.open(path); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //         callBackFunc: () {}, |  |  |  |                     } catch (ex) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //         isFullScreen: false, |  |  |  |                       showCommonBottomSheetWithoutHeight( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //         isCloseButtonVisible: true, |  |  |  |                         context, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //       ); |  |  |  |                         child: Utils.getErrorWidget(loadingText: "Cannot open file".needTranslation), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //     } |  |  |  |                         callBackFunc: () {}, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 //   } |  |  |  |                         isFullScreen: false, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 // }); |  |  |  |                         isCloseButtonVisible: true, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                       ); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                   } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 }); | 
			
		
	
		
		
			
				
					
					|  |  |  |               }, |  |  |  |               }, | 
			
		
	
		
		
			
				
					
					|  |  |  |               backgroundColor: AppColors.successColor, |  |  |  |               backgroundColor: AppColors.successColor, | 
			
		
	
		
		
			
				
					
					|  |  |  |               borderColor: AppColors.successColor, |  |  |  |               borderColor: AppColors.successColor, | 
			
		
	
	
		
		
			
				
					|  |  | 
 |