From 2d7aa5d80db53fba809bd4e341f5b4dce42e12de Mon Sep 17 00:00:00 2001 From: aamir-csol Date: Wed, 8 Apr 2026 15:53:14 +0300 Subject: [PATCH] radiology ai lab analysis & lab ai analysis api end points updates. --- lib/features/lab/lab_repo.dart | 8 +- lib/features/lab/lab_view_model.dart | 54 ++- lib/features/radiology/radiology_repo.dart | 5 +- .../radiology/radiology_view_model.dart | 15 +- .../LabResultByClinic.dart | 7 +- .../lab/lab_results/lab_result_details.dart | 2 +- .../radiology/radiology_result_page.dart | 377 +++++++++--------- 7 files changed, 235 insertions(+), 233 deletions(-) diff --git a/lib/features/lab/lab_repo.dart b/lib/features/lab/lab_repo.dart index 08946e97..82468ada 100644 --- a/lib/features/lab/lab_repo.dart +++ b/lib/features/lab/lab_repo.dart @@ -26,9 +26,9 @@ abstract class LabRepo { Future>> getLabResultsByAppointmentNo({required num appointmentNo, required num projectID, required num clinicID}); - Future>> getPatientAiOverViewLabOrders(var payload); + Future>> getPatientAiOverViewLabOrders({required int langId, required dynamic payload}); - Future>> getPatientAiOverViewLabOrder(var payload); + Future>> getPatientAiOverViewLabOrder(var payloa); } class LabRepoImp implements LabRepo { @@ -358,7 +358,7 @@ class LabRepoImp implements LabRepo { } @override - Future>> getPatientAiOverViewLabOrders(var labOrder) async { + Future>> getPatientAiOverViewLabOrders({required int langId, required dynamic payload}) async { try { GenericApiModel? apiResponse; Failure? failure; @@ -372,7 +372,7 @@ class LabRepoImp implements LabRepo { 'X-API-KEY': '9d9d2ac4c1fc302299dbb0fbb1b7fea1', 'accept': 'application/json', }, - body: {"lab_results": labOrder}, + body: {"lab_results": payload, "language_id": langId}, onFailure: (error, statusCode, {messageStatus, failureType}) { failure = failureType; }, diff --git a/lib/features/lab/lab_view_model.dart b/lib/features/lab/lab_view_model.dart index 6835badb..09caf578 100644 --- a/lib/features/lab/lab_view_model.dart +++ b/lib/features/lab/lab_view_model.dart @@ -447,20 +447,19 @@ class LabViewModel extends ChangeNotifier { minY = resultValue; } // if (highRefrenceValue < double.parse(element.referenceHigh ?? "0.0")) { - highRefrenceValue = double.parse(element.referenceHigh ?? "0.0"); - flagForHighReferenceRange = element.calculatedResultFlag; + highRefrenceValue = double.parse(element.referenceHigh ?? "0.0"); + flagForHighReferenceRange = element.calculatedResultFlag; // } // if (lowRefenceValue > double.parse(element.referenceLow ?? "0.0")) { - lowRefenceValue = double.parse(element.referenceLow ?? "0.0"); - flagForLowReferenceRange = element.calculatedResultFlag; + lowRefenceValue = double.parse(element.referenceLow ?? "0.0"); + flagForLowReferenceRange = element.calculatedResultFlag; // } - if(double.parse(element.referenceHigh ?? "0.0") == 0 ){ + if (double.parse(element.referenceHigh ?? "0.0") == 0) { highRefrenceValue = double.negativeInfinity; } - - if(double.parse(element.referenceLow ?? "0.0") == 0 ){ + if (double.parse(element.referenceLow ?? "0.0") == 0) { lowRefenceValue = double.negativeInfinity; } @@ -473,18 +472,16 @@ class LabViewModel extends ChangeNotifier { time: DateUtil.convertStringToDate(element.verifiedOnDateTime), referenceValue: element.calculatedResultFlag ?? "", )); - - } catch (e) { - } + } catch (e) {} }); if (flagForLowReferenceRange == null && flagForHighReferenceRange == null) { highRefrenceValue = maxY; lowRefenceValue = minY; } // - if (lowRefenceValue != double.negativeInfinity &&minY > lowRefenceValue) { + if (lowRefenceValue != double.negativeInfinity && minY > lowRefenceValue) { minY = lowRefenceValue - getInterval(); - }else if (highRefrenceValue != double.negativeInfinity && minY > highRefrenceValue) { + } else if (highRefrenceValue != double.negativeInfinity && minY > highRefrenceValue) { minY = highRefrenceValue - getInterval(); } @@ -494,17 +491,16 @@ class LabViewModel extends ChangeNotifier { lowTransformedReferenceValue = double.parse(transformValueInRange(lowRefenceValue, flagForLowReferenceRange ?? "").toStringAsFixed(1)); this.highRefrenceValue = double.parse(highRefrenceValue.toStringAsFixed(2)); this.lowRefenceValue = double.parse(lowRefenceValue.toStringAsFixed(2)); - if(highRefrenceValue != double.negativeInfinity &&maxY=1.0 && maxX < 5.0) return .3; - if(maxX >=5.0 && maxX < 10.0) return 1.5; - if(maxX >=10.0 && maxX < 50.0) return 2.5; - if(maxX >=50.0 && maxX < 100.0) return 5; - if(maxX >=100.0 && maxX < 200.0) return 10; + if (maxX < 1) return .2; + if (maxX >= 1.0 && maxX < 5.0) return .3; + if (maxX >= 5.0 && maxX < 10.0) return 1.5; + if (maxX >= 10.0 && maxX < 50.0) return 2.5; + if (maxX >= 50.0 && maxX < 100.0) return 5; + if (maxX >= 100.0 && maxX < 200.0) return 10; return 15; } @@ -617,7 +614,7 @@ class LabViewModel extends ChangeNotifier { rangeStart = 40.0; rangeEnd = 59.0; break; - // throw ArgumentError('Invalid flag: $flag'); + // throw ArgumentError('Invalid flag: $flag'); } // Clamp input value to 0-100 and map it to the range bounds @@ -845,9 +842,7 @@ class LabViewModel extends ChangeNotifier { notifyListeners(); } - Future getAiOverviewLabOrders({required PatientLabOrdersResponseModel labOrder, required String loadingText}) async { - // LoadingUtils.showFullScreenLoader(loadingText: "Loading and analysing your data,\nPlease be patient and let the AI do the magic. \nPlease be patient, This might take some time."); - // LoadingUtils.showFullScreenLoader(loadingText: loadingText); + Future getAiOverviewLabOrders({required int langId, required PatientLabOrdersResponseModel labOrder, required String loadingText}) async { isLabAIAnalysisNeedsToBeShown = true; notifyListeners(); @@ -875,7 +870,8 @@ class LabViewModel extends ChangeNotifier { } orderData["results"] = testResults; results.add(orderData); - final result = await labRepo.getPatientAiOverViewLabOrders(results); + + final result = await labRepo.getPatientAiOverViewLabOrders(payload: results, langId: langId); result.fold( (failure) async { LoaderBottomSheet.hideLoader(); @@ -903,7 +899,7 @@ class LabViewModel extends ChangeNotifier { // LoadingUtils.hideFullScreenLoader(); } - Future getAiOverviewSingleLabResult({required String langId, required LabResult recentLabResult, required String loadingText}) async { + Future getAiOverviewSingleLabResult({required int langId, required LabResult recentLabResult, required String loadingText}) async { LoaderBottomSheet.showLoader( loadingText: loadingText, showCloseButton: true, diff --git a/lib/features/radiology/radiology_repo.dart b/lib/features/radiology/radiology_repo.dart index a6ea293e..30b078ef 100644 --- a/lib/features/radiology/radiology_repo.dart +++ b/lib/features/radiology/radiology_repo.dart @@ -19,7 +19,7 @@ abstract class RadiologyRepo { Future>>> getPatientRadiologyOrderByAppointment({required num appointmentNo, required num projectID}); - Future>> getRadiologyAiAnalysis({required String reportData}); + Future>> getRadiologyAiAnalysis({required String reportData, required int langId,}); } class RadiologyRepoImp implements RadiologyRepo { @@ -223,9 +223,10 @@ class RadiologyRepoImp implements RadiologyRepo { } @override - Future>> getRadiologyAiAnalysis({required String reportData}) async { + Future>> getRadiologyAiAnalysis({required String reportData, required int langId}) async { Map payload = { "text": reportData, + "language_id": langId }; try { diff --git a/lib/features/radiology/radiology_view_model.dart b/lib/features/radiology/radiology_view_model.dart index c8385870..7386a5a0 100644 --- a/lib/features/radiology/radiology_view_model.dart +++ b/lib/features/radiology/radiology_view_model.dart @@ -127,8 +127,7 @@ class RadiologyViewModel extends ChangeNotifier { ); } - Future getRadiologyImage( - {required PatientRadiologyResponseModel patientRadiologyResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async { + Future getRadiologyImage({required PatientRadiologyResponseModel patientRadiologyResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async { final result = await radiologyRepo.getRadiologyImage(patientRadiologyResponseModel: patientRadiologyResponseModel); result.fold( @@ -149,12 +148,8 @@ class RadiologyViewModel extends ChangeNotifier { } Future getRadiologyPDF( - {required PatientRadiologyResponseModel patientRadiologyResponseModel, - required AuthenticatedUser authenticatedUser, - Function(dynamic)? onSuccess, - Function(String)? onError}) async { - final result = - await radiologyRepo.getRadiologyReportPDF(patientRadiologyResponseModel: patientRadiologyResponseModel, authenticatedUser: authenticatedUser); + {required PatientRadiologyResponseModel patientRadiologyResponseModel, required AuthenticatedUser authenticatedUser, Function(dynamic)? onSuccess, Function(String)? onError}) async { + final result = await radiologyRepo.getRadiologyReportPDF(patientRadiologyResponseModel: patientRadiologyResponseModel, authenticatedUser: authenticatedUser); result.fold( (failure) async => await errorHandlerService.handleError( @@ -229,7 +224,7 @@ class RadiologyViewModel extends ChangeNotifier { notifyListeners(); } - Future getRadiologyAiAnalysis({required String reportData, required String loadingText}) async { + Future getRadiologyAiAnalysis({required String reportData, required String loadingText, required int langId}) async { LoaderBottomSheet.showLoader( loadingText: loadingText, showCloseButton: true, @@ -238,7 +233,7 @@ class RadiologyViewModel extends ChangeNotifier { }, ); - final result = await radiologyRepo.getRadiologyAiAnalysis(reportData: reportData); + final result = await radiologyRepo.getRadiologyAiAnalysis(reportData: reportData, langId: langId); result.fold( (failure) async { diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart index c883c863..cd1718bd 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart @@ -168,15 +168,16 @@ class LabResultByClinic extends StatelessWidget { ], ), ).paddingSymmetrical(24.h, 24.h).onPress(() async { - final _dialogService = getIt.get(); - await _dialogService.showCommonBottomSheetWithoutH( + final dialogService = getIt.get(); + final appState = getIt.get(); + await dialogService.showCommonBottomSheetWithoutH( message: LocaleKeys.aiDisclaimer.tr(), label: LocaleKeys.consent.tr(), okLabel: LocaleKeys.acceptLbl.tr(), cancelLabel: LocaleKeys.rejectView.tr(), onOkPressed: () { context.pop(); - labViewModel.getAiOverviewLabOrders(labOrder: labOrder, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); + labViewModel.getAiOverviewLabOrders(langId: appState.getLanguageID(), labOrder: labOrder, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); }, onCancelPressed: () { context.pop(); diff --git a/lib/presentation/lab/lab_results/lab_result_details.dart b/lib/presentation/lab/lab_results/lab_result_details.dart index bb4b2d8b..feb1596a 100644 --- a/lib/presentation/lab/lab_results/lab_result_details.dart +++ b/lib/presentation/lab/lab_results/lab_result_details.dart @@ -197,7 +197,7 @@ class _LabResultDetailsState extends State { onOkPressed: () { context.pop(); labViewModel.getAiOverviewSingleLabResult( - langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); + langId: appState.getLanguageID(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); }, onCancelPressed: () { context.pop(); diff --git a/lib/presentation/radiology/radiology_result_page.dart b/lib/presentation/radiology/radiology_result_page.dart index 911cea01..96b35009 100644 --- a/lib/presentation/radiology/radiology_result_page.dart +++ b/lib/presentation/radiology/radiology_result_page.dart @@ -48,6 +48,14 @@ class _RadiologyResultPageState extends State { super.initState(); } + @override + void dispose() { + // Clear AI analysis data when leaving the screen + radiologyViewModel.closeRadiologyAIAnalysis(); + radiologyViewModel.setIsRadiologyAIAnalysisNeedsToBeShown(true); + super.dispose(); + } + @override Widget build(BuildContext context) { radiologyViewModel = Provider.of(context, listen: false); @@ -80,198 +88,199 @@ class _RadiologyResultPageState extends State { }); return Column( - children: [ - Expanded( - child: CollapsingListView( - title: LocaleKeys.radiologyResult.tr(context: context), - downloadReport: () async { - LoaderBottomSheet.showLoader(); - await radiologyViewModel - .getRadiologyPDF( - patientRadiologyResponseModel: widget.patientRadiologyResponseModel, - authenticatedUser: _appState.getAuthenticatedUser()!, - onError: (err) { - LoaderBottomSheet.hideLoader(); - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: err), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); - }) - .then((val) async { - LoaderBottomSheet.hideLoader(); - if (radiologyViewModel.patientRadiologyReportPDFBase64.isNotEmpty) { - String path = await Utils.createFileFromString(radiologyViewModel.patientRadiologyReportPDFBase64, "pdf"); - try { - OpenFilex.open(path); - } catch (ex) { - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: "Cannot open file"), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); + children: [ + Expanded( + child: CollapsingListView( + title: LocaleKeys.radiologyResult.tr(context: context), + downloadReport: () async { + LoaderBottomSheet.showLoader(); + await radiologyViewModel + .getRadiologyPDF( + patientRadiologyResponseModel: widget.patientRadiologyResponseModel, + authenticatedUser: _appState.getAuthenticatedUser()!, + onError: (err) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: err), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + }) + .then((val) async { + LoaderBottomSheet.hideLoader(); + if (radiologyViewModel.patientRadiologyReportPDFBase64.isNotEmpty) { + String path = await Utils.createFileFromString(radiologyViewModel.patientRadiologyReportPDFBase64, "pdf"); + try { + OpenFilex.open(path); + } catch (ex) { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: "Cannot open file"), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } } - } - }); - }, - // viewImage: () { - // if (radiologyViewModel.radiologyImageURL.isNotEmpty) { - // Uri uri = Uri.parse(radiologyViewModel.radiologyImageURL); - // launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); - // } else { - // Utils.showToast("Radiology image not available"); - // } - // }, - child: SingleChildScrollView( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 24.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 24.h), - Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 20.h, - hasShadow: true, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 16.h), - // widget.patientRadiologyResponseModel.description!.toText16(isBold: true), - SizedBox(height: 8.h), - Directionality( - textDirection: ui.TextDirection.ltr, - child: widget.patientRadiologyResponseModel.reportData!.trim().toText12(isBold: true, color: AppColors.textColorLight, isEnglishOnly: true), - ), - SizedBox(height: 16.h), - // CustomButton( - // text: LocaleKeys.viewRadiologyImage.tr(context: context), - // onPressed: () async { - // if (radiologyViewModel.radiologyImageURL.isNotEmpty) { - // Uri uri = Uri.parse(radiologyViewModel.radiologyImageURL); - // launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); - // } else { - // Utils.showToast("Radiology image not available"); - // } - // }, - // backgroundColor: AppColors.primaryRedColor, - // borderColor: AppColors.primaryRedColor, - // textColor: Colors.white, - // fontSize: 14, - // isBold: true, - // borderRadius: 12, - // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), - // height: 40.h, - // icon: AppAssets.download, - // iconColor: Colors.white, - // iconSize: 20.h, - // ), - // SizedBox(height: 16.h), - ], - ).paddingSymmetrical(16.h, 0.h), - ), - SizedBox(height: 24.h), - if (radVM.radiologyAiAnalysisResponse != null) - RadiologyAiAnalysisWidget( - key: _aiAnalysisKey, - data: radVM.radiologyAiAnalysisResponse!, + }); + }, + // viewImage: () { + // if (radiologyViewModel.radiologyImageURL.isNotEmpty) { + // Uri uri = Uri.parse(radiologyViewModel.radiologyImageURL); + // launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); + // } else { + // Utils.showToast("Radiology image not available"); + // } + // }, + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 24.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 24.h), + Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 20.h, + hasShadow: true, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 16.h), + // widget.patientRadiologyResponseModel.description!.toText16(isBold: true), + SizedBox(height: 8.h), + Directionality( + textDirection: ui.TextDirection.ltr, + child: widget.patientRadiologyResponseModel.reportData!.trim().toText12(isBold: true, color: AppColors.textColorLight, isEnglishOnly: true), + ), + SizedBox(height: 16.h), + // CustomButton( + // text: LocaleKeys.viewRadiologyImage.tr(context: context), + // onPressed: () async { + // if (radiologyViewModel.radiologyImageURL.isNotEmpty) { + // Uri uri = Uri.parse(radiologyViewModel.radiologyImageURL); + // launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); + // } else { + // Utils.showToast("Radiology image not available"); + // } + // }, + // backgroundColor: AppColors.primaryRedColor, + // borderColor: AppColors.primaryRedColor, + // textColor: Colors.white, + // fontSize: 14, + // isBold: true, + // borderRadius: 12, + // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + // height: 40.h, + // icon: AppAssets.download, + // iconColor: Colors.white, + // iconSize: 20.h, + // ), + // SizedBox(height: 16.h), + ], + ).paddingSymmetrical(16.h, 0.h), ), - ], + SizedBox(height: 24.h), + if (radVM.radiologyAiAnalysisResponse != null) + RadiologyAiAnalysisWidget( + key: _aiAnalysisKey, + data: radVM.radiologyAiAnalysisResponse!, + ), + ], + ), ), ), ), ), - ), - radVM.radiologyAiAnalysisResponse == null - ? Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 24.h, - hasShadow: true, - ), - child: Column( - children: [ - SizedBox(height: 24.h), - widget.patientRadiologyResponseModel.dIAPACSURL != "" - ? CustomButton( - text: LocaleKeys.openRad.tr(context: context), - onPressed: () async { - if (radiologyViewModel.radiologyImageURL.isNotEmpty) { - Uri uri = Uri.parse(radiologyViewModel.radiologyImageURL); - launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); - } else { - Utils.showToast("Radiology image not available"); - } - }, - backgroundColor: AppColors.primaryRedColor, - borderColor: AppColors.primaryRedColor, - textColor: Colors.white, - fontSize: 16, - isBold: true, - borderRadius: 12, - padding: EdgeInsets.fromLTRB(10, 0, 10, 0), - height: 56.h, - icon: AppAssets.imageIcon, - iconColor: Colors.white, - iconSize: 20.h, - ).paddingSymmetrical(24.h, 0.h) - : SizedBox.shrink(), - Container( - height: 56.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12.r), - gradient: LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - stops: [0.236, 1.0], // 53.6% and 100% - colors: [ - Color(0xFF8A38F5), // Transparent - Color(0xFFE20BBB), // Solid #F8F8F8 + radVM.radiologyAiAnalysisResponse == null + ? Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 24.h, + hasShadow: true, + ), + child: Column( + children: [ + SizedBox(height: 24.h), + widget.patientRadiologyResponseModel.dIAPACSURL != "" + ? CustomButton( + text: LocaleKeys.openRad.tr(context: context), + onPressed: () async { + if (radiologyViewModel.radiologyImageURL.isNotEmpty) { + Uri uri = Uri.parse(radiologyViewModel.radiologyImageURL); + launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); + } else { + Utils.showToast("Radiology image not available"); + } + }, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + textColor: Colors.white, + fontSize: 16, + isBold: true, + borderRadius: 12, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 56.h, + icon: AppAssets.imageIcon, + iconColor: Colors.white, + iconSize: 20.h, + ).paddingSymmetrical(24.h, 0.h) + : SizedBox.shrink(), + Container( + height: 56.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12.r), + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + stops: [0.236, 1.0], // 53.6% and 100% + colors: [ + Color(0xFF8A38F5), // Transparent + Color(0xFFE20BBB), // Solid #F8F8F8 + ], + ), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 4.w, left: 4.w), + child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white), + ), + LocaleKeys.generateAiAnalysisRadResult.tr(context: context).toText16(isBold: true, color: Colors.white) ], ), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(right: 4.w, left: 4.w), - child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white), - ), - LocaleKeys.generateAiAnalysisRadResult.tr(context: context).toText16(isBold: true, color: Colors.white) - ], - ), - ).paddingSymmetrical(24.h, 12.h).onPress(() async { - final _dialogService = getIt.get(); - await _dialogService.showCommonBottomSheetWithoutH( - message: LocaleKeys.aiDisclaimer.tr(), - label: LocaleKeys.consent.tr(), - okLabel: LocaleKeys.acceptLbl.tr(), - cancelLabel: LocaleKeys.rejectView.tr(), - onOkPressed: () { - context.pop(); - radiologyViewModel.getRadiologyAiAnalysis( - reportData: widget.patientRadiologyResponseModel.reportData ?? "", - loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context), - ); - }, - onCancelPressed: () { - context.pop(); - }, - ); - }), - ], - ), - ) - : SizedBox.shrink(), - ], - ); + ).paddingSymmetrical(24.h, 12.h).onPress(() async { + final _dialogService = getIt.get(); + await _dialogService.showCommonBottomSheetWithoutH( + message: LocaleKeys.aiDisclaimer.tr(), + label: LocaleKeys.consent.tr(), + okLabel: LocaleKeys.acceptLbl.tr(), + cancelLabel: LocaleKeys.rejectView.tr(), + onOkPressed: () { + context.pop(); + radiologyViewModel.getRadiologyAiAnalysis( + reportData: widget.patientRadiologyResponseModel.reportData ?? "", + loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context), + langId: _appState.getLanguageID(), + ); + }, + onCancelPressed: () { + context.pop(); + }, + ); + }), + ], + ), + ) + : SizedBox.shrink(), + ], + ); }), ); }