@ -37,6 +37,7 @@ import 'package:hmg_patient_app_new/presentation/ask_doctor/doctor_response_page
import ' package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart ' ;
import ' package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart ' ;
import ' package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart ' ;
import ' package:hmg_patient_app_new/services/dialog_service.dart ' ;
import ' package:hmg_patient_app_new/theme/colors.dart ' ;
import ' package:hmg_patient_app_new/theme/colors.dart ' ;
import ' package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart ' ;
import ' package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart ' ;
import ' package:hmg_patient_app_new/widgets/buttons/custom_button.dart ' ;
import ' package:hmg_patient_app_new/widgets/buttons/custom_button.dart ' ;
@ -148,41 +149,55 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
} ) ;
} ) ;
} ,
} ,
onCancelTap: ( ) async {
onCancelTap: ( ) async {
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . cancellingAppointmentPleaseWait . tr ( context: context ) ) ;
showCommonBottomSheetWithoutHeight (
await myAppointmentsViewModel . cancelAppointment (
title: LocaleKeys . notice . tr ( context: context ) ,
patientAppointmentHistoryResponseModel: widget . patientAppointmentHistoryResponseModel ,
context ,
onSuccess: ( apiResponse ) {
child: Utils . getWarningWidget (
LoaderBottomSheet . hideLoader ( ) ;
loadingText: LocaleKeys . cancelAppointmentConfirmMessage . tr ( context: context ) ,
myAppointmentsViewModel . setIsAppointmentDataToBeLoaded ( true ) ;
isShowActionButtons: true ,
myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
onCancelTap: ( ) {
showCommonBottomSheetWithoutHeight (
Navigator . of ( context ) . pop ( ) ;
context ,
} ,
child: Utils . getSuccessWidget ( loadingText: LocaleKeys . appointmentCancelledSuccessfully . tr ( context: context ) ) ,
onConfirmTap: ( ) async {
callBackFunc: ( ) {
Navigator . of ( context ) . pop ( ) ;
Navigator . of ( context ) . pop ( ) ;
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . cancellingAppointmentPleaseWait . tr ( context: context ) ) ;
} ,
await myAppointmentsViewModel . cancelAppointment (
title: " " ,
patientAppointmentHistoryResponseModel: widget . patientAppointmentHistoryResponseModel ,
isCloseButtonVisible: true ,
onSuccess: ( apiResponse ) async {
isDismissible: false ,
LoaderBottomSheet . hideLoader ( ) ;
isFullScreen: false ,
myAppointmentsViewModel . setIsAppointmentDataToBeLoaded ( true ) ;
) ;
myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
} ,
showCommonBottomSheet (
onError: ( err ) {
context ,
LoaderBottomSheet . hideLoader ( ) ;
child: Utils . getSuccessWidget ( loadingText: LocaleKeys . appointmentCancelledSuccessfully . tr ( context: context ) ) ,
showCommonBottomSheetWithoutHeight (
callBackFunc: ( str ) {
context ,
Navigator . of ( context ) . pop ( ) ;
child: Utils . getErrorWidget ( loadingText: err . toString ( ) ) ,
} ,
callBackFunc: ( ) { } ,
title: " " ,
title: " " ,
isCloseButtonVisible: false ,
isCloseButtonVisible: true ,
isDismissible: false ,
isDismissible: false ,
isFullScreen: false ,
isFullScreen: false ,
isAutoDismiss: true ,
) ;
height: ResponsiveExtension . screenHeight * 0.3 ,
} ) ;
) ;
var isEventAddedOrRemoved = await CalenderUtilsNew . instance . checkAndRemove ( id: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " , ) ;
} ,
setState ( ( ) {
onError: ( err ) {
myAppointmentsViewModel . setAppointmentReminder ( isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
LoaderBottomSheet . hideLoader ( ) ;
} ) ;
showCommonBottomSheetWithoutHeight (
context ,
child: Utils . getErrorWidget ( loadingText: err . toString ( ) ) ,
callBackFunc: ( ) { } ,
title: " " , isCloseButtonVisible: true , isDismissible: false , isFullScreen: false ) ;
} ) ;
} ) ,
callBackFunc: ( ) { } ,
isFullScreen: false ,
isCloseButtonVisible: true ,
) ;
/ / var isEventAddedOrRemoved = await CalenderUtilsNew . instance . checkAndRemove ( id: " ${ widget . patientAppointmentHistoryResponseModel . appointmentNo } " , ) ;
/ / setState ( ( ) {
/ / myAppointmentsViewModel . setAppointmentReminder ( isEventAddedOrRemoved , widget . patientAppointmentHistoryResponseModel ) ;
/ / } ) ;
} ,
} ,
onRescheduleTap: ( ) async {
onRescheduleTap: ( ) async {
openDoctorScheduleCalendar ( ) ;
openDoctorScheduleCalendar ( ) ;
@ -987,7 +1002,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
doctorImageURL: widget . patientAppointmentHistoryResponseModel . doctorImageURL ,
doctorImageURL: widget . patientAppointmentHistoryResponseModel . doctorImageURL ,
doctorTitle: widget . patientAppointmentHistoryResponseModel . doctorTitle ,
doctorTitle: widget . patientAppointmentHistoryResponseModel . doctorTitle ,
name: widget . patientAppointmentHistoryResponseModel . doctorNameObj ,
name: widget . patientAppointmentHistoryResponseModel . doctorNameObj ,
nationalityFlagURL: " https://hmgwebservices.com/Images/flag/SYR.png ",
nationalityFlagURL: " ",
speciality: [ ] ,
speciality: [ ] ,
clinicName: widget . patientAppointmentHistoryResponseModel . clinicName ,
clinicName: widget . patientAppointmentHistoryResponseModel . clinicName ,
projectName: widget . patientAppointmentHistoryResponseModel . projectName ,
projectName: widget . patientAppointmentHistoryResponseModel . projectName ,
@ -1036,17 +1051,18 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
myAppointmentsViewModel . initAppointmentsViewModel ( ) ;
myAppointmentsViewModel . initAppointmentsViewModel ( ) ;
myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
myAppointmentsViewModel . getPatientAppointments ( true , false ) ;
Navigator . of ( context ) . pop ( ) ;
Navigator . of ( context ) . pop ( ) ;
} ,
} , title: " " , height: ResponsiveExtension . screenHeight * 0.3 , isAutoDismiss: true , isCloseButtonVisible: true , isDismissible: false , isFullScreen: false ,
title: " " ,
height: ResponsiveExtension . screenHeight * 0.3 ,
isCloseButtonVisible: true ,
isDismissible: false ,
isFullScreen: false ,
isSuccessDialog: true ) ;
isSuccessDialog: true ) ;
} ) ;
} ) ;
/ / LoaderBottomSheet . hideLoader ( ) ;
/ / LoaderBottomSheet . hideLoader ( ) ;
case 15 :
case 15 :
break ;
getIt . get < DialogService > ( ) . showCommonBottomSheetWithoutH (
message: LocaleKeys . upcomingPaymentPending . tr ( context: context ) ,
label: LocaleKeys . notice . tr ( ) ,
onOkPressed: ( ) { } ,
okLabel: " confirm " ,
cancelLabel: LocaleKeys . confirm . tr ( context: context ) ,
) ;
case 20 :
case 20 :
myAppointmentsViewModel . setIsPatientAppointmentShareLoading ( true ) ;
myAppointmentsViewModel . setIsPatientAppointmentShareLoading ( true ) ;
Navigator . of ( context ) . push (
Navigator . of ( context ) . push (