diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 9636d236..39e290a1 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; @@ -604,6 +605,7 @@ class _BookSuccessState extends State { } checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( @@ -617,21 +619,23 @@ class _BookSuccessState extends State { if (paymentInfo == 'Success') { createAdvancePayment(res, appo); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getApplePayAPQ(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( - Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo), - context) + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + context) .then((res) { print("Printing Payment Status Reponse!!!!"); print(res); @@ -644,15 +648,15 @@ class _BookSuccessState extends State { }).catchError((err) { print(err); }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); service - .createAdvancePayment( - appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context) + .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], + res['Fort_id'], res['PaymentMethod'], context) .then((res) { print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest( @@ -660,9 +664,10 @@ class _BookSuccessState extends State { paymentReference, appo.appointmentNo.toString()); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } addAdvancedNumberRequest( @@ -675,9 +680,10 @@ class _BookSuccessState extends State { print(res); getAppoQR(context); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Widget _getQRAppo() { @@ -831,11 +837,13 @@ class _BookSuccessState extends State { .generateAppointmentQR(widget.patientShareResponse, context) .then((res) { print(res); + GifLoaderDialogUtils.hideDialog(context); navigateToQR(context, res['AppointmentQR']); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToQR(context, String appoQR) async { diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index fb60638d..e92c2348 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -151,6 +151,7 @@ class _QRCodeState extends State { ), ), Container( + margin: EdgeInsets.zero, alignment: Alignment.bottomCenter, child: Column( mainAxisAlignment: MainAxisAlignment.end,