|
|
|
@ -20,6 +20,7 @@ import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
|
|
|
import 'package:open_filex/open_filex.dart';
|
|
|
|
import 'package:open_filex/open_filex.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
|
|
|
|
|
|
|
|
class RadiologyResultPage extends StatefulWidget {
|
|
|
|
class RadiologyResultPage extends StatefulWidget {
|
|
|
|
RadiologyResultPage({super.key, required this.patientRadiologyResponseModel});
|
|
|
|
RadiologyResultPage({super.key, required this.patientRadiologyResponseModel});
|
|
|
|
@ -52,6 +53,14 @@ class _RadiologyResultPageState extends State<RadiologyResultPage> {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: CollapsingListView(
|
|
|
|
child: CollapsingListView(
|
|
|
|
title: LocaleKeys.radiologyResult.tr(context: context),
|
|
|
|
title: LocaleKeys.radiologyResult.tr(context: context),
|
|
|
|
|
|
|
|
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: SingleChildScrollView(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.h),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.h),
|
|
|
|
@ -71,31 +80,34 @@ class _RadiologyResultPageState extends State<RadiologyResultPage> {
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
// widget.patientRadiologyResponseModel.description!.toText16(isBold: true),
|
|
|
|
// widget.patientRadiologyResponseModel.description!.toText16(isBold: true),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
widget.patientRadiologyResponseModel.reportData!.trim().toText12(isBold: true, color: AppColors.textColorLight),
|
|
|
|
Directionality(
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
CustomButton(
|
|
|
|
child: widget.patientRadiologyResponseModel.reportData!.trim().toText12(isBold: true, color: AppColors.textColorLight, isEnglishOnly: true),
|
|
|
|
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,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
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),
|
|
|
|
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,
|
|
|
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
// 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),
|
|
|
|
).paddingSymmetrical(16.h, 0.h),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -116,7 +128,11 @@ class _RadiologyResultPageState extends State<RadiologyResultPage> {
|
|
|
|
text: LocaleKeys.downloadReport.tr(context: context),
|
|
|
|
text: LocaleKeys.downloadReport.tr(context: context),
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
await radiologyViewModel.getRadiologyPDF(patientRadiologyResponseModel: widget.patientRadiologyResponseModel, authenticatedUser: _appState.getAuthenticatedUser()!, onError: (err) {
|
|
|
|
await radiologyViewModel
|
|
|
|
|
|
|
|
.getRadiologyPDF(
|
|
|
|
|
|
|
|
patientRadiologyResponseModel: widget.patientRadiologyResponseModel,
|
|
|
|
|
|
|
|
authenticatedUser: _appState.getAuthenticatedUser()!,
|
|
|
|
|
|
|
|
onError: (err) {
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
@ -125,7 +141,8 @@ class _RadiologyResultPageState extends State<RadiologyResultPage> {
|
|
|
|
isFullScreen: false,
|
|
|
|
isFullScreen: false,
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).then((val) async {
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((val) async {
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
if (radiologyViewModel.patientRadiologyReportPDFBase64.isNotEmpty) {
|
|
|
|
if (radiologyViewModel.patientRadiologyReportPDFBase64.isNotEmpty) {
|
|
|
|
String path = await Utils.createFileFromString(radiologyViewModel.patientRadiologyReportPDFBase64, "pdf");
|
|
|
|
String path = await Utils.createFileFromString(radiologyViewModel.patientRadiologyReportPDFBase64, "pdf");
|
|
|
|
|