pull/196/head
haroon amjad 2 days ago
parent 29447cc9fa
commit 47b50e35a1

@ -1,4 +1,3 @@
<svg height="1792" id="download" width="1792" xmlns="http://www.w3.org/2000/svg">
<path
d="M1344 1344q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm256 0q0-26-19-45t-45-19-45 19-19 45 19 45 45 19 45-19 19-45zm128-224v320q0 40-28 68t-68 28H160q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h465l135 136q58 56 136 56t136-56l136-136h464q40 0 68 28t28 68zm-325-569q17 41-14 70l-448 448q-18 19-45 19t-45-19L403 621q-31-29-14-70 17-39 59-39h256V64q0-26 19-45t45-19h256q26 0 45 19t19 45v448h256q42 0 59 39z"></path>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.73038 1.67378e-07L7.73039 1.67378e-07C9.37341 -9.67694e-06 10.6639 -1.7412e-05 11.6715 0.135446C12.704 0.274261 13.5232 0.564537 14.1668 1.20819C14.8105 1.85183 15.1007 2.67102 15.2396 3.70352C15.375 4.71108 15.375 6.0016 15.375 7.64462V7.7304C15.375 9.37342 15.375 10.6639 15.2396 11.6715C15.1007 12.704 14.8105 13.5232 14.1668 14.1668C13.5232 14.8105 12.704 15.1007 11.6715 15.2396C10.6639 15.375 9.3734 15.375 7.73038 15.375H7.6446C6.00158 15.375 4.71108 15.375 3.70352 15.2396C2.67102 15.1007 1.85183 14.8105 1.20819 14.1668C0.564537 13.5232 0.274261 12.704 0.135446 11.6715C-1.7412e-05 10.6639 -9.67693e-06 9.37341 1.67378e-07 7.73039L1.67378e-07 7.73038L1.67378e-07 7.64462L1.67378e-07 7.64461C-9.67693e-06 6.00159 -1.7412e-05 4.71108 0.135446 3.70352C0.274261 2.67102 0.564537 1.85183 1.20819 1.20819C1.85183 0.564537 2.67102 0.274261 3.70352 0.135446C4.71108 -1.7412e-05 6.00159 -9.67694e-06 7.64461 1.67378e-07L7.64462 1.67378e-07L7.73038 1.67378e-07ZM7.6875 3.1875C8.10171 3.1875 8.4375 3.52329 8.4375 3.9375V6.28379H8.85004L8.86442 6.28376C8.9186 6.28359 9.02672 6.28324 9.12235 6.29699C9.20821 6.30934 9.59436 6.37258 9.77265 6.77369C9.95094 7.1748 9.73916 7.50383 9.6908 7.57583C9.63693 7.65604 9.56422 7.73607 9.5278 7.77617L9.51814 7.78682L9.01431 8.34503C8.84929 8.52797 8.67863 8.71716 8.51617 8.85448C8.33191 9.01023 8.05864 9.1875 7.6875 9.1875C7.31636 9.1875 7.04308 9.01023 6.85883 8.85448C6.69637 8.71716 6.52571 8.52796 6.36069 8.34502L5.85686 7.78682L5.8472 7.77616C5.81077 7.73607 5.73807 7.65603 5.6842 7.57583C5.63584 7.50383 5.42406 7.1748 5.60235 6.77369C5.78064 6.37258 6.16679 6.30934 6.25265 6.29699C6.34828 6.28324 6.4564 6.28359 6.51058 6.28376L6.52496 6.28379H6.9375L6.9375 3.9375C6.9375 3.52329 7.27329 3.1875 7.6875 3.1875ZM4.6875 11.4375C4.6875 11.0233 5.02329 10.6875 5.4375 10.6875H9.9375C10.3517 10.6875 10.6875 11.0233 10.6875 11.4375C10.6875 11.8517 10.3517 12.1875 9.9375 12.1875H5.4375C5.02329 12.1875 4.6875 11.8517 4.6875 11.4375Z" fill="#F43333"/>
</svg>

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -195,7 +195,7 @@ class ApiClientImp implements ApiClient {
}
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 2007395;
// body['PatientID'] = 809289;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";
@ -301,14 +301,16 @@ class ApiClientImp implements ApiClient {
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode,
messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
} else if (parsed['IsAuthenticated'] == false) {
onFailure(
"User is not Authenticated",
statusCode,
failureType:
UnAuthenticatedUserFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'] ?? "User is not Authenticated", url: url),
);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
}
// else if (parsed['IsAuthenticated'] == false) {
// onFailure(
// "User is not Authenticated",
// statusCode,
// failureType:
// UnAuthenticatedUserFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'] ?? "User is not Authenticated", url: url),
// );
// }
else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode,
messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);

@ -188,14 +188,16 @@ class RadiologyRepoImp implements RadiologyRepo {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
final radOrders;
List<PatientRadiologyResponseModel> radOrders = [];
try {
if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) {
final list = response['FinalRadiologyList'];
radOrders = list.map((item) => PatientRadiologyResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientRadiologyResponseModel>();
} else {
final list = response['FinalRadiologyListAPI'];
radOrders = list.map((item) => PatientRadiologyResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientRadiologyResponseModel>();
if (response['FinalRadiologyListAPI'] != null && response['FinalRadiologyListAPI'].length != 0) {
final list = response['FinalRadiologyListAPI'];
radOrders = list.map((item) => PatientRadiologyResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientRadiologyResponseModel>();
}
}
apiResponse = GenericApiModel<List<PatientRadiologyResponseModel>>(

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -34,6 +36,13 @@ class _MyDoctorsPageState extends State<MyDoctorsPage> {
int? expandedIndex;
final Map<int, GlobalKey> _groupKeys = {};
@override
void initState() {
scheduleMicrotask(() {
myAppointmentsViewModel.getPatientMyDoctors();
});
super.initState();
}
@override
Widget build(BuildContext context) {

@ -41,7 +41,7 @@ class DoctorProfilePage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 24.h),
// SizedBox(height: 24.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [

@ -41,21 +41,54 @@ class LabResultByClinic extends StatelessWidget {
Expanded(
child: CollapsingListView(
title: LocaleKeys.labResults.tr(),
aiOverview: () async {
final _dialogService = getIt.get<DialogService>();
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));
},
onCancelPressed: () {
context.pop();
});
downloadReport: () async {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.generatingReport.tr(context: context));
await labViewModel
.getLabResultReportPDF(
labOrder: labOrder,
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
})
.then((val) async {
LoaderBottomSheet.hideLoader();
if (labViewModel.patientLabResultReportPDFBase64.isNotEmpty) {
String path = await Utils.createFileFromString(labViewModel.patientLabResultReportPDFBase64, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Cannot open file"),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
}
});
},
// aiOverview: () async {
// final _dialogService = getIt.get<DialogService>();
// 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));
// },
// onCancelPressed: () {
// context.pop();
// });
// },
child: SingleChildScrollView(
child: Column(
spacing: 8.h,
@ -109,53 +142,46 @@ class LabResultByClinic extends StatelessWidget {
borderRadius: 24.h,
hasShadow: true,
),
child: CustomButton(
text: LocaleKeys.downloadReport.tr(context: context),
onPressed: () async {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.generatingReport.tr(context: context));
await labViewModel
.getLabResultReportPDF(
labOrder: labOrder,
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
})
.then((val) async {
LoaderBottomSheet.hideLoader();
if (labViewModel.patientLabResultReportPDFBase64.isNotEmpty) {
String path = await Utils.createFileFromString(labViewModel.patientLabResultReportPDFBase64, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Cannot open file"),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
}
});
},
backgroundColor: AppColors.successColor,
borderColor: AppColors.successColor,
textColor: Colors.white,
fontSize: 16.f,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 45.h,
icon: AppAssets.download,
iconColor: Colors.white,
iconSize: 20.h,
).paddingSymmetrical(24.h, 24.h),
child: 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.generateAiAnalysis.tr(context: context).toText16(isBold: true)
],
),
).paddingSymmetrical(24.h, 24.h).onPress(() async {
final _dialogService = getIt.get<DialogService>();
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));
},
onCancelPressed: () {
context.pop();
});
}),
),
],
),

@ -34,41 +34,97 @@ class LabResultDetails extends StatelessWidget {
Widget build(BuildContext context) {
LabViewModel labViewModel = Provider.of<LabViewModel>(context, listen: false);
final appState = getIt.get<AppState>();
return CollapsingListView(
title: LocaleKeys.labResultDetails.tr(context: context),
aiOverview: () async {
final _dialogService = getIt.get<DialogService>();
await _dialogService.showCommonBottomSheetWithoutH(
message: LocaleKeys.aiDisclaimer.tr(),
label: LocaleKeys.consent.tr(),
okLabel: LocaleKeys.acceptLbl.tr(),
cancelLabel: LocaleKeys.rejectView.tr(),
onOkPressed: () {
context.pop();
labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
},
onCancelPressed: () {
context.pop();
});
},
child: SingleChildScrollView(
child: Column(
spacing: 16.h,
children: [
LabNameAndStatus(context),
getLabDescription(context),
LabGraph(context),
Selector<LabViewModel, LabOrderResponseByAi?>(
selector: (_, model) => model.labOrderResponseByAi,
builder: (_, aiData, __) {
if (aiData != null) {
return AiAnalysisWidget(data: aiData).paddingOnly(bottom: 16.h);
}
return const SizedBox.shrink();
},
return Scaffold(
body: Column(
children: [
Expanded(
child: CollapsingListView(
title: LocaleKeys.labResultDetails.tr(context: context),
// aiOverview: () async {
// final _dialogService = getIt.get<DialogService>();
// await _dialogService.showCommonBottomSheetWithoutH(
// message: LocaleKeys.aiDisclaimer.tr(),
// label: LocaleKeys.consent.tr(),
// okLabel: LocaleKeys.acceptLbl.tr(),
// cancelLabel: LocaleKeys.rejectView.tr(),
// onOkPressed: () {
// context.pop();
// labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
// },
// onCancelPressed: () {
// context.pop();
// });
// },
child: SingleChildScrollView(
child: Column(
spacing: 16.h,
children: [
LabNameAndStatus(context),
getLabDescription(context),
LabGraph(context),
Selector<LabViewModel, LabOrderResponseByAi?>(
selector: (_, model) => model.labOrderResponseByAi,
builder: (_, aiData, __) {
if (aiData != null) {
return AiAnalysisWidget(data: aiData).paddingOnly(bottom: 16.h);
}
return const SizedBox.shrink();
},
),
],
).paddingAll(24.h),
),
),
],
).paddingAll(24.h),
),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true,
),
child: 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.generateAiAnalysis.tr(context: context).toText16(isBold: true)
],
),
).paddingSymmetrical(24.h, 24.h).onPress(() async {
final _dialogService = getIt.get<DialogService>();
await _dialogService.showCommonBottomSheetWithoutH(
message: LocaleKeys.aiDisclaimer.tr(),
label: LocaleKeys.consent.tr(),
okLabel: LocaleKeys.acceptLbl.tr(),
cancelLabel: LocaleKeys.rejectView.tr(),
onOkPressed: () {
context.pop();
labViewModel.getAiOverviewSingleLabResult(
langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
},
onCancelPressed: () {
context.pop();
});
}),
),
],
),
);
}

@ -25,6 +25,7 @@ class CollapsingListView extends StatelessWidget {
VoidCallback? requests;
VoidCallback? sendEmail;
VoidCallback? doctorResponse;
VoidCallback? downloadReport;
Widget? bottomChild;
Widget? trailing;
bool isClose;
@ -47,6 +48,7 @@ class CollapsingListView extends StatelessWidget {
this.requests,
this.sendEmail,
this.doctorResponse,
this.downloadReport,
this.isLeading = true,
this.trailing,
this.leadingCallback,
@ -89,6 +91,7 @@ class CollapsingListView extends StatelessWidget {
requests: requests,
sendEmail: sendEmail,
doctorResponse: doctorResponse,
downloadReport: downloadReport,
bottomChild: bottomChild,
trailing: trailing,
aiOverview: aiOverview,
@ -200,6 +203,7 @@ class ScrollAnimatedTitle extends StatefulWidget implements PreferredSizeWidget
VoidCallback? requests;
VoidCallback? sendEmail;
VoidCallback? doctorResponse;
VoidCallback? downloadReport;
Widget? bottomChild;
Widget? trailing;
@ -217,6 +221,7 @@ class ScrollAnimatedTitle extends StatefulWidget implements PreferredSizeWidget
this.requests,
this.sendEmail,
this.doctorResponse,
this.downloadReport,
this.bottomChild,
this.trailing,
});
@ -295,6 +300,7 @@ class _ScrollAnimatedTitleState extends State<ScrollAnimatedTitle> {
if (widget.doctorResponse != null) actionButton(context, t, title: LocaleKeys.doctorResponses.tr(context: context), icon: AppAssets.doctorResponseIcon).onPress(widget.doctorResponse!),
if (widget.search != null) Utils.buildSvgWithAssets(icon: AppAssets.search_icon).onPress(widget.search!),
if (widget.aiOverview != null) actionButton(context, t, title: LocaleKeys.aiOverView.tr(context: context), icon: AppAssets.aiOverView, isAiButton: true).onPress(widget.aiOverview!),
if (widget.downloadReport != null) actionButton(context, t, title: LocaleKeys.downloadReport.tr(context: context), icon: AppAssets.download).onPress(widget.downloadReport!),
if (widget.trailing != null) widget.trailing!,
]
],

Loading…
Cancel
Save