|
|
|
|
@ -63,10 +63,10 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
scheduleMicrotask(() {
|
|
|
|
|
if (AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)) {
|
|
|
|
|
prescriptionsViewModel.setPrescriptionsDetailsLoading();
|
|
|
|
|
prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
|
|
|
|
|
}
|
|
|
|
|
// if (AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)) {
|
|
|
|
|
// prescriptionsViewModel.setPrescriptionsDetailsLoading();
|
|
|
|
|
// prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
@ -363,7 +363,52 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
|
|
|
|
|
svgIcon: AppAssets.prescription_item_icon,
|
|
|
|
|
isLargeText: true,
|
|
|
|
|
iconSize: 36.w,
|
|
|
|
|
).onPress(() {
|
|
|
|
|
).onPress(() async {
|
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: "Fetching Appointment Prescriptions...".needTranslation);
|
|
|
|
|
await prescriptionsViewModel.getPrescriptionDetails(
|
|
|
|
|
getPrescriptionRequestModel(),
|
|
|
|
|
onSuccess: (val) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
if (val.data.isNotEmpty) {
|
|
|
|
|
PatientPrescriptionsResponseModel patientPrescriptionsResponseModel = PatientPrescriptionsResponseModel(
|
|
|
|
|
doctorImageURL: widget.patientAppointmentHistoryResponseModel.doctorImageURL,
|
|
|
|
|
doctorName: widget.patientAppointmentHistoryResponseModel.doctorNameObj,
|
|
|
|
|
appointmentDate: widget.patientAppointmentHistoryResponseModel.appointmentDate,
|
|
|
|
|
clinicDescription: widget.patientAppointmentHistoryResponseModel.clinicName,
|
|
|
|
|
decimalDoctorRate: widget.patientAppointmentHistoryResponseModel.decimalDoctorRate,
|
|
|
|
|
name: widget.patientAppointmentHistoryResponseModel.projectName,
|
|
|
|
|
isHomeMedicineDeliverySupported: false,
|
|
|
|
|
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
|
|
|
|
|
doctorID: widget.patientAppointmentHistoryResponseModel.doctorID,
|
|
|
|
|
setupID: widget.patientAppointmentHistoryResponseModel.setupID,
|
|
|
|
|
);
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: PrescriptionDetailPage(isFromAppointments: true, prescriptionsResponseModel: patientPrescriptionsResponseModel),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: "You don't have any prescriptions for this appointment.".needTranslation),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
// Navigator.of(context).push(
|
|
|
|
|
// CustomPageRoute(
|
|
|
|
|
// page: VaccineListPage(),
|
|
|
|
|
|