|
|
|
@ -243,42 +243,123 @@ class AppointmentCard extends StatelessWidget {
|
|
|
|
(patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) ||
|
|
|
|
(patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) ||
|
|
|
|
!Utils.isClinicAllowedForRebook(patientAppointmentHistoryResponseModel.clinicID ?? 0))) &&
|
|
|
|
!Utils.isClinicAllowedForRebook(patientAppointmentHistoryResponseModel.clinicID ?? 0))) &&
|
|
|
|
AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) {
|
|
|
|
AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) {
|
|
|
|
return CustomButton(
|
|
|
|
if (((patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) &&
|
|
|
|
text: isFromMedicalReport ? LocaleKeys.selectAppointment.tr(context: context) : LocaleKeys.viewDetails.tr(context: context),
|
|
|
|
DateTime.now().difference(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate)).inDays <= 15)) {
|
|
|
|
onPressed: () {
|
|
|
|
return Row(
|
|
|
|
if (isFromMedicalReport) {
|
|
|
|
children: [
|
|
|
|
if (isForFeedback) {
|
|
|
|
Expanded(
|
|
|
|
contactUsViewModel!.setPatientFeedbackSelectedAppointment(patientAppointmentHistoryResponseModel);
|
|
|
|
flex: 6,
|
|
|
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
|
|
|
text: LocaleKeys.askDoctor.tr(context: context),
|
|
|
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingDoctorAvailability.tr(context: context));
|
|
|
|
|
|
|
|
await myAppointmentsViewModel.isDoctorAvailable(
|
|
|
|
|
|
|
|
projectID: patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
|
|
|
doctorId: patientAppointmentHistoryResponseModel.doctorID,
|
|
|
|
|
|
|
|
clinicId: patientAppointmentHistoryResponseModel.clinicID,
|
|
|
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
|
|
|
if (value) {
|
|
|
|
|
|
|
|
await myAppointmentsViewModel.getAskDoctorRequestTypes(onSuccess: (val) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
title: LocaleKeys.askDoctor.tr(context: context),
|
|
|
|
|
|
|
|
child: AskDoctorRequestTypeSelect(
|
|
|
|
|
|
|
|
askDoctorRequestTypeList: myAppointmentsViewModel.askDoctorRequestTypeList,
|
|
|
|
|
|
|
|
myAppointmentsViewModel: myAppointmentsViewModel,
|
|
|
|
|
|
|
|
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
print("Doctor is not available");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
borderRadius: 12.r,
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
|
|
|
|
|
|
|
// height: isTablet || isFoldable ? 46.h : 40.h,
|
|
|
|
|
|
|
|
height: 40.h,
|
|
|
|
|
|
|
|
icon: AppAssets.ask_doctor_icon,
|
|
|
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
iconSize: 16.h,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: (isFoldable || isTablet) ? 50.h : 40.h,
|
|
|
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
|
|
|
color: AppColors.textColor,
|
|
|
|
|
|
|
|
borderRadius: 10.h,
|
|
|
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
|
|
|
color: AppColors.textColor,
|
|
|
|
|
|
|
|
width: 1.2,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Transform.flip(
|
|
|
|
|
|
|
|
flipX: appState.isArabic(),
|
|
|
|
|
|
|
|
child: Utils.buildSvgWithAssets(
|
|
|
|
|
|
|
|
icon: AppAssets.forward_arrow_icon,
|
|
|
|
|
|
|
|
iconColor: AppColors.whiteColor,
|
|
|
|
|
|
|
|
width: 24.w,
|
|
|
|
|
|
|
|
height: 24.h,
|
|
|
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
).toShimmer2(isShow: isLoading).onPress(() {
|
|
|
|
|
|
|
|
_goToDetails(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return CustomButton(
|
|
|
|
|
|
|
|
text: isFromMedicalReport ? LocaleKeys.selectAppointment.tr(context: context) : LocaleKeys.viewDetails.tr(context: context),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
if (isFromMedicalReport) {
|
|
|
|
|
|
|
|
if (isForFeedback) {
|
|
|
|
|
|
|
|
contactUsViewModel!.setPatientFeedbackSelectedAppointment(patientAppointmentHistoryResponseModel);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
medicalFileViewModel!.setSelectedMedicalReportAppointment(patientAppointmentHistoryResponseModel);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Navigator.pop(context, false);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
medicalFileViewModel!.setSelectedMedicalReportAppointment(patientAppointmentHistoryResponseModel);
|
|
|
|
Navigator.of(context)
|
|
|
|
|
|
|
|
.push(
|
|
|
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
|
|
|
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.then((_) {
|
|
|
|
|
|
|
|
myAppointmentsViewModel.initAppointmentsViewModel();
|
|
|
|
|
|
|
|
myAppointmentsViewModel.getPatientAppointments(true, false);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Navigator.pop(context, false);
|
|
|
|
},
|
|
|
|
} else {
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
Navigator.of(context)
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
.push(
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
CustomPageRoute(
|
|
|
|
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
|
|
|
|
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel),
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
),
|
|
|
|
borderRadius: 12.r,
|
|
|
|
)
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
|
|
|
.then((_) {
|
|
|
|
// height: isTablet || isFoldable ? 46.h : 40.h,
|
|
|
|
myAppointmentsViewModel.initAppointmentsViewModel();
|
|
|
|
height: 40.h,
|
|
|
|
myAppointmentsViewModel.getPatientAppointments(true, false);
|
|
|
|
icon: isFromMedicalReport ? AppAssets.checkmark_icon : null,
|
|
|
|
});
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
}
|
|
|
|
iconSize: 16.h,
|
|
|
|
},
|
|
|
|
);
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
}
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
borderRadius: 12.r,
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
|
|
|
|
|
|
|
// height: isTablet || isFoldable ? 46.h : 40.h,
|
|
|
|
|
|
|
|
height: 40.h,
|
|
|
|
|
|
|
|
icon: isFromMedicalReport ? AppAssets.checkmark_icon : null,
|
|
|
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
iconSize: 16.h,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (isFromMedicalReport) {
|
|
|
|
if (isFromMedicalReport) {
|
|
|
|
if (isForEyeMeasurements) {
|
|
|
|
if (isForEyeMeasurements) {
|
|
|
|
@ -309,7 +390,6 @@ class AppointmentCard extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
|