Compare commits

...

9 Commits

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

@ -22,8 +22,8 @@ var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'http://10.50.100.198:4422/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -333,13 +333,20 @@ var GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSt
var SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
var CHECK_SCANNED_NFC_QR_CODE = 'Services/Patients.svc/REST/Patient_ValidationMachine_ForNFC';
var HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
var LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory';
var INSERT_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert';
var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update';
var GET_PATIENT_SHARE_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForWalkIn';
var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWalkinAppointment';
//URL to get medicine and pharmacies list
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
@ -601,9 +608,9 @@ var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceFor
var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental";
var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamaralive/Home/GetInstallments';
var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamara/Home/GetInstallments';
var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid=';
var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamara/api/OnlineTamara/order_status?orderid=';
var UPDATE_TAMARA_STATUS = 'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus';
@ -665,13 +672,15 @@ var GET_WE_CARE_TOUR_URL = 'Services/Consent.svc/Rest/Consent_VirtualJurny_Url_G
var GET_DENTAL_INSTRUCTIONS = 'Services/OUTPs.svc/Rest/getProcedureNotification';
var INSERT_WALKIN_APPOINTMENT = "Services/Doctors.svc/REST/InsertWalkinAppointment";
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
var payFortEnvironment = FortEnvironment.production;
var applePayMerchantId = "merchant.com.hmgwebservices";
// var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat";
// var payFortEnvironment = FortEnvironment.production;
// var applePayMerchantId = "merchant.com.hmgwebservices";
var payFortEnvironment = FortEnvironment.test;
var applePayMerchantId = "merchant.com.hmgwebservices.uat";
class AppGlobal {
static var context;

@ -1976,4 +1976,11 @@ const Map localizedValues = {
"selectHospitalBloodDonation": {"en": "Please select the hospital you want to book an appointment with: ", "ar": "يرجى اختيار المستشفى الذي تريد حجز موعد معه:"},
"wecare": {"en": "We Care", "ar": "نحن نهتم"},
"myinstructions": {"en": "My Instructions", "ar": "تعليماتي"},
"waitingAppointment": {"en": "Waiting appointment", "ar": "انتظار الموعد"},
"whatWaitingAppointment": {"en": "What is Waiting appointment?", "ar": "ما هو انتظار الموعد؟"},
"waitingAppointmentText1": {"en": "The waiting appointments feature allows you to book an appointment while you are inside the hospital building, and in case there is no available slot in the doctors schedule.", "ar": "تتيح لك خاصية انتظار المواعيد حجز موعد أثناء تواجدك داخل مبنى المستشفى، وفي حالة عدم وجود وقت متاح في جدول الطبيب."},
"waitingAppointmentText2": {"en": "Waiting for an appointment can take more than 2 hours.", "ar": "يمكن أن يستغرق انتظار الموعد أكثر من ساعتين."},
"waitingAppointmentText3": {"en": "Note: You must have to pay within 10 minutes of booking, otherwise your appointment will be cancelled automatically", "ar": "ملحوظة: يجب عليك الدفع خلال 10 دقائق من الحجز، وإلا سيتم إلغاء موعدك تلقائيًا"},
"waitingAppointmentVerificationMethod": {"en": "Please select verification method", "ar": "الرجاء تحديد طريقة التحقق"},
"howToUseVerificationMethod": {"en": "How to use verification methods?", "ar": "كيفية استخدام طرق التحقق؟"},
};

@ -193,7 +193,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 283093; //4609100
// body['PatientID'] = 4768303; //4609100
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574

@ -18,6 +18,8 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart';
import '../../models/Appointments/DoctorListResponse.dart';
bool isAppArabic = false;
class ProjectViewModel extends BaseViewModel {
GAnalytics get analytics => locator<GAnalytics>();
@ -45,6 +47,25 @@ class ProjectViewModel extends BaseViewModel {
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel();
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel();
int waitingAppointmentProjectID = 0;
DoctorList? waitingAppointmentDoctor;
String waitingAppointmentNFCCode = "";
setWaitingAppointmentDoctor(DoctorList waitingAppointmentDoctor) {
this.waitingAppointmentDoctor = waitingAppointmentDoctor;
notifyListeners();
}
setWaitingAppointmentNFCCode(String waitingAppointmentNFCCode) {
this.waitingAppointmentNFCCode = waitingAppointmentNFCCode;
notifyListeners();
}
setWaitingAppointmentProjectID(int projectID) {
this.waitingAppointmentProjectID = projectID;
notifyListeners();
}
void setIsAllAppointmentsLoaded(bool value) {
_isAllAppointmentsLoaded = value;
notifyListeners();

@ -1,26 +1,38 @@
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -41,7 +53,10 @@ class BookConfirm extends StatefulWidget {
bool isLiveCareAppointment;
int initialSlotDuration;
BookConfirm({required this.doctor, required this.selectedDate, required this.isLiveCareAppointment, required this.selectedTime, required this.initialSlotDuration});
bool isWalkinAppointment = false;
BookConfirm(
{required this.doctor, required this.selectedDate, required this.isLiveCareAppointment, required this.selectedTime, required this.initialSlotDuration, required this.isWalkinAppointment});
late DoctorsListService service;
late PatientShareResponse patientShareResponse;
@ -62,6 +77,13 @@ class _BookConfirmState extends State<BookConfirm> {
bool isEligible = false;
bool isCash = false;
String? selectedPaymentMethod = "";
String? selectedInstallments = "";
String? tamaraPaymentStatus;
String? tamaraOrderID;
String? transID;
late MyInAppBrowser browser;
@override
void initState() {
// widget.authUser = new AuthenticatedUser();
@ -212,10 +234,14 @@ class _BookConfirmState extends State<BookConfirm> {
elevation: 0,
onPressed: () async {
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
if (isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
if (widget.isWalkinAppointment) {
getWalkinAppointmentPatientShare();
} else {
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
if (isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
}
}
},
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)),
@ -226,6 +252,336 @@ class _BookConfirmState extends State<BookConfirm> {
);
}
openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) {
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PaymentDialog(
appo: appo,
patientShareResponse: patientShareResponse,
isCashPatient: isCash,
onPaymentMethodSelected: () {},
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: false,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) => SizedBox()).then((value) {
print(value);
if (value != null) {
navigateToPaymentMethod(context, value as PatientShareResponse);
// projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo);
} else {
// projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo);
}
});
}
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.doctor.projectID;
appo.clinicID = widget.doctor.clinicID;
appo.clinicName = widget.doctor.clinicName;
appo.projectName = widget.doctor.projectName;
appo.appointmentNo = DateTime.now().millisecondsSinceEpoch;
appo.isLiveCareAppointment = false;
appo.doctorID = widget.doctor.doctorID;
appo.appointmentDate = DateUtil.convertDateToString(DateTime.now()); //widget.patientShareResponse.appointmentDate;
appo.serviceID = widget.patientShareResponse.serviceID;
Navigator.push(
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax)))
.then((value) {
selectedPaymentMethod = value[0];
if (value != null) {
if (selectedPaymentMethod == "ApplePay") {
if (projectViewModel.havePrivilege(103)) {
startApplePay(appo, patientShareResponse);
} else {
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
}
} else {
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
}
projectViewModel.analytics.appointment.payment_method(appointment_type: 'Walk-In', clinic: widget.doctor.clinicName, payment_method: value[0], payment_type: 'appointment');
}
});
}
void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async {
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel? payfortProjectDetailsRespModel;
await context.read<PayfortViewModel>().getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()).then((value) {
payfortProjectDetailsRespModel = value!;
});
applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = appo.clinicID;
applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR";
// applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com";
applePayInsertRequest.customerID = projectViewModel.user.patientID;
applePayInsertRequest.customerName = projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = appo.doctorID;
applePayInsertRequest.projectID = appo.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = projectViewModel.user.patientID;
applePayInsertRequest.patientTypeID = projectViewModel.user.patientType;
applePayInsertRequest.patientOutSA = projectViewModel.user.outSA;
applePayInsertRequest.appointmentDate = appo.appointmentDate;
applePayInsertRequest.appointmentNo = appo.appointmentNo;
applePayInsertRequest.orderDescription = "Appointment Payment";
applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = patientShareResponse.patientShareWithTax.toString();
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
applePayInsertRequest.userName = projectViewModel.user.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel!.merchantIdentifier!;
applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel!.signature;
applePayInsertRequest.accessCode = payfortProjectDetailsRespModel!.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel!.shaRequest;
applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel!.shaResponse;
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
if (res["MessageStatus"] == 1) {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Walk-In appointment payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
}
openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0];
selectedInstallments = paymentMethod[1];
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
browser.openPaymentBrowser(
amount,
"Walk-In appointment payment",
transID!,
appo.projectID.toString(),
authenticatedUser.emailAddress!,
paymentMethod[0]!,
authenticatedUser.patientType,
authenticatedUser.firstName!,
authenticatedUser.patientID,
authenticatedUser,
browser,
widget.patientShareResponse.isLiveCareAppointment!,
"2",
widget.patientShareResponse.isLiveCareAppointment! ? widget.patientShareResponse.clinicID.toString() : "",
context,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID,
paymentMethod[1]);
// }
}
onBrowserLoadStart(String url) {
if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status'];
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
}
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
try {
if (selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(transID!, appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus!.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID!, num.parse(selectedInstallments!), appo);
// } else {
// updateTamaraRequestStatus(
// "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID! != null ? tamaraOrderID! : "", num.parse(selectedInstallments!), appo);
// }
} else {
checkPaymentStatus(appo);
}
} catch (err) {
print(err);
}
}
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID!, int.parse(selectedInstallments!), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID! : "", int.parse(selectedInstallments!), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, num selectedInstallments, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
try {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus!.toLowerCase() == "approved") {
insertWalkInAppointment(context, widget.doctor, widget.initialSlotDuration, tamaraOrderID);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
} catch (err) {
print(err);
}
}
addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
markAppointmentForTamara(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.markAppointmentForTamara(appo.projectID!, appo.appointmentNo.toString()).then((res) {
GifLoaderDialogUtils.hideDialog(context);
sendNfcCheckInRequest(projectViewModel.waitingAppointmentNFCCode, 2, int.parse(appo.appointmentNo), projectViewModel.waitingAppointmentProjectID);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
String txn_ref;
num amount;
String payment_method;
final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(transID!, false, context).then((res) {
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
txn_ref = res['Merchant_Reference'];
amount = res['Amount'];
payment_method = res['PaymentMethod'];
GifLoaderDialogUtils.hideDialog(context);
insertWalkInAppointment(context, widget.doctor, widget.initialSlotDuration, res);
projectViewModel.analytics.appointment.payment_success(
appointment_type: 'Walk-In', payment_method: payment_method, clinic: appo.clinicName, hospital: appo.projectName, txn_amount: "$amount", txn_currency: currency, txn_number: txn_ref);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.appointment.payment_fail(
appointment_type: 'Walk-In',
payment_method: selectedPaymentMethod,
clinic: appo.clinicName,
hospital: appo.projectName,
txn_amount: widget.patientShareResponse.patientShareWithTax.toString(),
txn_currency: currency,
error_type: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err.toString());
print(err);
});
}
Widget showInfo(String title, String des) {
return Container(
child: Row(
@ -253,6 +609,52 @@ class _BookConfirmState extends State<BookConfirm> {
);
}
// canPayForWalkInAppointment() {
// GifLoaderDialogUtils.showMyDialog(context);
// widget.service
// .canPayForWalkInAppointment(
// widget.doctor.projectID!,
// widget.doctor.clinicID!,
// )
// .then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// getWalkinAppointmentPatientShare();
// }).catchError((err) {
// GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err);
// print(err);
// });
// }
getWalkinAppointmentPatientShare() {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
GifLoaderDialogUtils.showMyDialog(context);
appo.doctorTitle = widget.doctor.doctorTitle;
appo.doctorNameObj = widget.doctor.name;
appo.appointmentDate = DateUtil.convertDateToString(DateTime.now());
appo.projectName = widget.doctor.projectName;
widget.service
.getPatientShareForWalkInAppointment(
widget.doctor.clinicID!,
widget.doctor.projectID!,
widget.doctor.doctorID!,
)
.then((res) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res["OnlineCheckInAppointmentsWalkInModel"]);
GifLoaderDialogUtils.hideDialog(context);
if (widget.patientShareResponse.patientShareWithTax != 0 || widget.patientShareResponse.patientShareWithTax != 0.0) {
openPaymentDialog(appo, widget.patientShareResponse!);
} else {
insertWalkInAppointment(context, widget.doctor, widget.initialSlotDuration, null);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
@ -320,11 +722,102 @@ class _BookConfirmState extends State<BookConfirm> {
});
}
insertWalkInAppointment(context, DoctorList docObject, int initialSlotDuration, paymentRes) async {
GifLoaderDialogUtils.showMyDialog(
context,
);
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.doctorID = docObject.doctorID;
appo.clinicID = docObject.clinicID;
appo.projectID = docObject.projectID;
widget.service
.insertWalkInAppointment(
docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
if (res['MessageStatus'] == 1) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
appo.appointmentNo = res["AppointmentNo"]; // Add appointment No to the appointment project
Future.delayed(Duration(milliseconds: 500), () {
if (selectedPaymentMethod == "TAMARA") {
markAppointmentForTamara(appo);
addAdvancedNumberRequestTamara("Tamara-Advance-0000", paymentRes, res["AppointmentNo"].toString(), appo);
} else {
if (widget.patientShareResponse.patientShareWithTax != 0 || widget.patientShareResponse.patientShareWithTax != 0.0) {
createAdvancePayment(paymentRes, appo);
} else {
sendNfcCheckInRequest(projectViewModel.waitingAppointmentNFCCode, 2, int.parse(res["AppointmentNo"]), projectViewModel.waitingAppointmentProjectID);
}
}
});
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(
context,
);
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID!)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(
context,
);
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
sendNfcCheckInRequest(projectViewModel.waitingAppointmentNFCCode, 2, int.parse(appointmentID), projectViewModel.waitingAppointmentProjectID);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
sendNfcCheckInRequest(String nfcId, int checkInBy, int appoNo, int projectID) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.sendCheckinNfcRequest(appoNo, nfcId, projectID, checkInBy, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
_showMyDialog(res["SuccessMsg"], this.context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
_showMyDialog(err, this.context);
});
}
insertAppointment(context, DoctorList docObject, int initialSlotDuration) async {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
String logs = await sharedPref.getString('selectedLogSlots');
List<dynamic> decodedLogs = json.decode(logs);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
GifLoaderDialogUtils.showMyDialog(
context,
);
AppoitmentAllHistoryResultList appo;
widget.service
// .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel)
@ -382,7 +875,9 @@ class _BookConfirmState extends State<BookConfirm> {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
widget.selectedDate = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[0];
widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
GifLoaderDialogUtils.showMyDialog(
context,
);
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(
@ -446,7 +941,9 @@ class _BookConfirmState extends State<BookConfirm> {
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
int languageID = projectViewModel.isArabic ? 1 : 2;
String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
GifLoaderDialogUtils.showMyDialog(
context,
);
widget.service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) {
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;
@ -575,4 +1072,32 @@ class _BookConfirmState extends State<BookConfirm> {
),
);
}
Future<void> _showMyDialog(String message, BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Alert'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(message),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
},
),
],
);
},
);
}
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_info.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -520,15 +521,9 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
// if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17) {
// navigateToDentalComplaints(context);
// } else {
if (DocAvailableAppointments.areSlotsAvailable) {
if (DocAvailableAppointments.selectedTime == TranslationBase.of(context).waitingAppointment) {
if (projectViewModel.isLogin) {
if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) {
navigateToDentalComplaints(context);
} else {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
navigateToBookConfirm(context);
projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
}
canPayForWalkInAppointment();
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
@ -539,9 +534,30 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
} else
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
// }
} else {
if (DocAvailableAppointments.areSlotsAvailable) {
if (projectViewModel.isLogin) {
if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) {
navigateToDentalComplaints(context);
} else {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
navigateToBookConfirm(context);
projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
}
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).loginToUseService,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {navigateToLogin()},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
}
}
Future navigateToDentalComplaints(BuildContext context) async {
@ -586,8 +602,33 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
selectedDate: DocAvailableAppointments.selectedDate!,
selectedTime: DocAvailableAppointments.selectedTime!,
initialSlotDuration: DocAvailableAppointments.initialSlotDuration!,
isWalkinAppointment: false,
),
),
);
}
Future navigateToWaitingAppointment(context) async {
projectViewModel.setWaitingAppointmentProjectID(widget.doctor.projectID!);
projectViewModel.setWaitingAppointmentDoctor(widget.doctor);
Navigator.push(
context,
FadePage(
page: WaitingAppointmentInfo(),
),
);
}
canPayForWalkInAppointment() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.canPayForWalkInAppointment(widget.doctor.clinicID!, widget.doctor.projectID!, widget.doctor.doctorID!).then((res) {
GifLoaderDialogUtils.hideDialog(context);
navigateToWaitingAppointment(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
}

@ -384,9 +384,7 @@ class _QRCodeState extends State<QRCode> {
sendNfcCheckInRequest(String nfcId, int checkInBy) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.sendCheckinNfcRequest(widget!.patientShareResponse!.appointmentNo!, nfcId, widget.patientShareResponse!.projectID!, checkInBy, context).then((res) {
print(res);

@ -60,6 +60,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
var language;
bool isLiveCareSchedule = false;
bool isWaitingAppointmentAvailable = false;
// String selectedLogSlots ='';
@override
@ -206,7 +208,9 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear();
DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
if (isWaitingAppointmentAvailable && DateUtils.isSameDay(dateStart, DateTime.now())) {
dayEvents.add(TimeSlot(isoTime: TranslationBase.of(context).waitingAppointment, start: DateTime.now(), end: DateTime.now(), vidaDate: ""));
}
freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v);
});
@ -349,6 +353,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
// isWaitingAppointmentAvailable = res['IsAllowToBookWaitingAppointment']; // true;
isWaitingAppointmentAvailable = true; // true;
DocAvailableAppointments.initialSlotDuration = res['InitialSlotDuration'];
DocAvailableAppointments.areAppointmentsAvailable = true;
freeSlotsResponse = res['FreeTimeSlots'];
@ -362,7 +368,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_calendarController.selectedDate = DateUtil.convertStringToDate(
widget.doctorSchedule['Date'],
)
}
},
});
});
} else {

@ -0,0 +1,113 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_verification.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class WaitingAppointmentInfo extends StatelessWidget {
const WaitingAppointmentInfo({super.key});
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).waitingAppointment,
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context).size.width,
decoration: containerRadius(Colors.white, 10),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(
"assets/images/new/waitingAppo.svg",
width: 52.0,
height: 52.0,
),
mHeight(11),
Text(
TranslationBase.of(context).whatWaitingAppointment,
maxLines: 1,
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
),
mHeight(11),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).waitingAppointmentText1,
style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, letterSpacing: -1.04, height: 35 / 24, overflow: TextOverflow.clip),
),
),
mHeight(18),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Text(
TranslationBase.of(context).waitingAppointmentText2,
style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, letterSpacing: -1.04, height: 35 / 24, overflow: TextOverflow.clip),
),
),
mHeight(24),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.warning,
size: 20,
color: Color(0xffA78618),
),
mWidth(10),
Container(
width: MediaQuery.of(context).size.width * 0.7,
child: Text(
TranslationBase.of(context).waitingAppointmentText3,
style: TextStyle(
fontSize: 14, fontStyle: FontStyle.italic, fontWeight: FontWeight.w600, color: Color(0xffA78618), letterSpacing: -1.04, height: 35 / 24, overflow: TextOverflow.clip),
),
),
],
),
],
),
),
),
],
),
),
),
bottomSheet: Container(
height: 80,
color: CustomColors.white,
padding: EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 25.0),
child: Container(
child: DefaultButton(
TranslationBase.of(context).continues,
() {
Navigator.push(
context,
FadePage(
page: WaitingAppointmentVerification(),
),
);
},
color: CustomColors.accentColor,
),
),
),
);
}
}

@ -0,0 +1,292 @@
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import '../../../uitl/utils.dart';
class WaitingAppointmentVerification extends StatefulWidget {
const WaitingAppointmentVerification({super.key});
@override
State<WaitingAppointmentVerification> createState() => _WaitingAppointmentVerificationState();
}
class _WaitingAppointmentVerificationState extends State<WaitingAppointmentVerification> {
String selectedVerificationMethod = "QR";
late ProjectViewModel projectViewModel;
late LocationUtils locationUtils;
ProjectDetailListModel projectDetailListModel = ProjectDetailListModel();
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).waitingAppointment,
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
mHeight(11),
Text(
TranslationBase.of(context).waitingAppointmentVerificationMethod,
maxLines: 1,
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.04, height: 35 / 24),
),
mHeight(12),
Container(
width: MediaQuery.of(context).size.width,
decoration: containerRadius(Colors.white, 10),
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 0.0, 16.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkWell(
onTap: () {
setState(() {
selectedVerificationMethod = "QR";
});
},
child: Row(
children: [
Container(
width: 20,
height: 20,
decoration: containerColorRadiusBorderWidth(selectedVerificationMethod == "QR" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
),
mWidth(6),
Container(
height: 40.0,
width: 40.0,
padding: EdgeInsets.all(7.0),
child: SvgPicture.asset(
"assets/images/new/services/qr_code.svg",
),
),
Text(
TranslationBase.of(context).pharmaLiveCareScanQR,
style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, fontWeight: FontWeight.w600, letterSpacing: -1.04, height: 35 / 24, overflow: TextOverflow.clip),
),
],
),
),
Divider(),
InkWell(
onTap: () {
setState(() {
selectedVerificationMethod = "NFC";
});
},
child: Row(
children: [
Container(
width: 20,
height: 20,
decoration: containerColorRadiusBorderWidth(selectedVerificationMethod == "NFC" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
),
mWidth(6),
Container(
height: 40.0,
width: 40.0,
padding: EdgeInsets.all(7.0),
child: SvgPicture.asset(
"assets/images/new/services/contactless.svg",
),
),
Text(
TranslationBase.of(context).scanNFC,
style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, fontWeight: FontWeight.w600, letterSpacing: -1.04, height: 35 / 24, overflow: TextOverflow.clip),
),
],
),
),
Divider(),
InkWell(
onTap: () {
setState(() {
selectedVerificationMethod = "Location";
});
},
child: Row(
children: [
Container(
width: 20,
height: 20,
decoration: containerColorRadiusBorderWidth(selectedVerificationMethod == "Location" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
),
mWidth(6),
Container(
height: 40.0,
width: 40.0,
padding: EdgeInsets.all(7.0),
child: SvgPicture.asset(
"assets/images/new/services/location.svg",
),
),
Text(
TranslationBase.of(context).checkInViaLocation,
style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, fontWeight: FontWeight.w600, letterSpacing: -1.04, height: 35 / 24, overflow: TextOverflow.clip),
),
],
),
),
mHeight(6),
],
),
),
),
mHeight(12),
Container(
width: MediaQuery.of(context).size.width,
decoration: containerRadius(Colors.white, 10),
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 0.0, 16.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
mHeight(12),
Text(
TranslationBase.of(context).howToUseVerificationMethod,
maxLines: 1,
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -1.04, height: 35 / 24),
),
mHeight(12),
Image.asset(
'assets/images/new/NFCCheckIn_QR_gps_HMG.png',
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
),
mHeight(12),
],
),
),
),
],
),
),
),
bottomSheet: Container(
height: 80,
color: CustomColors.white,
padding: EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 25.0),
child: Container(
child: DefaultButton(
TranslationBase.of(context).continues,
() {
startVerification();
},
color: CustomColors.accentColor,
),
),
),
);
}
startVerification() {
switch (selectedVerificationMethod) {
case "QR":
startQRCodeScan();
break;
case "NFC":
startNFCScan();
break;
case "Location":
startLocationCheckIn();
break;
}
}
checkScannedNFCAndQRCode(String nfcId) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.checkScannedNFCAndQRCode(nfcId, projectViewModel.waitingAppointmentDoctor!.projectID!).then((res) {
GifLoaderDialogUtils.hideDialog(context);
projectViewModel.setWaitingAppointmentNFCCode(nfcId);
if (res["returnValue"] == 1) {
navigateToBookConfirm(context);
} else {
AppToast.showErrorToast(message: "Invalid verification point scanned.");
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
Future navigateToBookConfirm(context) async {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
Navigator.push(
context,
FadePage(
page: BookConfirm(
doctor: projectViewModel.waitingAppointmentDoctor!,
isLiveCareAppointment: false,
selectedDate: formatter.format(DateTime.now()),
selectedTime: TranslationBase.of(context).waitingAppointment,
initialSlotDuration: 15,
isWalkinAppointment: true,
),
),
);
}
startLocationCheckIn() async {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(callBack: (value) {
projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, projectViewModel.waitingAppointmentProjectID);
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000;
projectViewModel.setWaitingAppointmentNFCCode(projectDetailListModel.checkInQrCode!);
print(dist);
if (dist <= projectDetailListModel.geofenceRadius!) {
navigateToBookConfirm(context);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
}
});
}
startNFCScan() {
Future.delayed(const Duration(milliseconds: 500), () {
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
checkScannedNFCAndQRCode(nfcId);
});
}, onCancel: () {
// Navigator.of(context).pop();
// locator<GAnalytics>().todoList.to_do_list_nfc_cancel(widget.appointment!);
});
});
}
startQRCodeScan() async {
String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent));
if (onlineCheckInQRCode != "") {
checkScannedNFCAndQRCode(onlineCheckInQRCode);
} else {}
}
}

@ -51,8 +51,11 @@ class DoctorView extends StatefulWidget {
class _DoctorViewState extends State<DoctorView> with AutomaticKeepAliveClientMixin {
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
super.build(context);
return InkWell(
onTap: () {
@ -217,7 +220,7 @@ class _DoctorViewState extends State<DoctorView> with AutomaticKeepAliveClientMi
}
getDoctorsProfile(context, DoctorList docObject, {isAppo, bool isContinueDentalPlan = false}) {
int languageID = context.read<ProjectViewModel>().isArabic ? 1 : 2;
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService();

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/waiting_appointment/waiting_appointment_info.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
@ -299,23 +300,68 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}
void goToBookConfirm() {
if (DocAvailableAppointments.areSlotsAvailable)
navigateToBookConfirm(context);
else
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
if (DocAvailableAppointments.selectedTime == TranslationBase.of(context).waitingAppointment) {
canPayForWalkInAppointment();
} else {
if (DocAvailableAppointments.areSlotsAvailable)
navigateToBookConfirm(context);
else
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
}
canPayForWalkInAppointment() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.canPayForWalkInAppointment(widget.appo.clinicID!, widget.appo.projectID!, widget.appo.doctorID!).then((res) {
GifLoaderDialogUtils.hideDialog(context);
navigateToWaitingAppointment(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err, localContext: context);
print(err);
});
}
Future navigateToWaitingAppointment(context) async {
DoctorList doctor = new DoctorList();
doctor.name = widget.appo.doctorNameObj;
doctor.clinicID = widget.appo.clinicID;
doctor.projectID = widget.appo.projectID;
doctor.doctorID = widget.appo.doctorID;
doctor.clinicName = widget.appo.clinicName;
doctor.projectName = widget.appo.projectName;
doctor.doctorTitle = widget.appo.doctorTitle;
doctor.doctorImageURL = widget.appo.doctorImageURL;
doctor.speciality = widget.appo.doctorSpeciality;
doctor.nationalityFlagURL = "";
doctor.doctorRate = widget.appo.doctorRate;
doctor.noOfPatientsRate = widget.appo.noOfPatientsRate;
projectViewModel?.setWaitingAppointmentProjectID(widget.appo.projectID!);
projectViewModel?.setWaitingAppointmentDoctor(doctor);
Navigator.push(
context,
FadePage(
page: WaitingAppointmentInfo(),
),
);
}
Future navigateToBookConfirm(context) async {
Navigator.push(
context,
FadePage(
page: BookConfirm(
context,
FadePage(
page: BookConfirm(
doctor: getDoctorObject(),
isLiveCareAppointment: widget.appo.isLiveCareAppointment!,
selectedDate: DocAvailableAppointments.selectedDate!,
selectedTime: DocAvailableAppointments.selectedTime!,
initialSlotDuration: 0,
)));
isWalkinAppointment: false,
),
),
);
}
void getDoctorRatingsDetails() {

@ -1114,7 +1114,6 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo);
}
});
projectViewModel.analytics.todoList.to_do_list_pay_now(appo);
}

@ -22,8 +22,7 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'
as family;
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family;
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
@ -76,8 +75,7 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var authProvider = new AuthProvider();
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
int currentTab = 0;
late PageController pageController;
@ -94,8 +92,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
bool _showBottomNavigationBar = true;
///inject the user data
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
final authService = new AuthProvider();
@ -122,22 +119,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
"appointmentdate": "2022-01-19",
"appointmenttime": "12:10",
"PatientName": "Testing",
"session_id":
"1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg",
"session_id": "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg",
"token":
"T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9OGMyY2IyYWFiZmZmMzI4ZmEwMjgxNDdmMGFhZGI0N2JiZjdmZWY4MjpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTBOekkxTmpZeE5ESTJPWDV5U1hobFZqWmphbTEzUkZkTVZtZGxlV1ZzU0RoelFreC1mZyZjcmVhdGVfdGltZT0xNjQ3MjU2NjE0Jm5vbmNlPTAuMjgzNDgyNjM1NDczNjQ2OCZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjQ3MjU4NDE0JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
"DoctorImageURL":
"https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg",
"DoctorImageURL": "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg",
"callerID": "9920",
"PatientID": "1231755",
"is_call": "true"
};
void _requestIOSPermissions() {
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(
alert: true,
badge: true,
sound: true,
@ -153,8 +145,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return Future.value(false);
} else {
DateTime now = DateTime.now();
if (currentBackPressTime == null ||
now.difference(currentBackPressTime!) > Duration(seconds: 2)) {
if (currentBackPressTime == null || now.difference(currentBackPressTime!) > Duration(seconds: 2)) {
currentBackPressTime = now;
AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false);
@ -169,18 +160,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
List<ImagesInfo> imagesInfo = [];
imagesInfo.add(
ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
);
imagesInfo.add(
ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
);
Navigator.push(
@ -199,11 +186,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
if (tab == 4) {
List<ImagesInfo> imagesInfo = [];
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png'));
imagesInfo.add(
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png'));
Navigator.push(
context,
@ -248,8 +232,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
});
});
projectViewModel.analytics.bottomTabNavigation
.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin);
projectViewModel.analytics.bottomTabNavigation.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin);
}
getToDoCount() {
@ -260,11 +243,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
// toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(
res['AppointmentActiveNumber'],
res['AncillaryOrderListCount'],
true,
toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
@ -303,10 +282,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
int languageID =
Provider.of<ProjectViewModel>(context, listen: false).isArabic
? 1
: 2;
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familyFileProvider.getSharedRecordByStatus(languageID);
}
// Future.delayed(Duration(seconds: 3)).then((result) async {
@ -322,20 +298,20 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// HMGNetworkConnectivity(context).start();
_firebaseMessaging.getToken().then((String? token) {
print("Firebase Token: " + token!);
sharedPref.setString(PUSH_TOKEN, token!);
if (Platform.isIOS) {
FirebaseMessaging.instance.getAPNSToken().then((value) {
print("Push APNS getToken: " + value!);
AppSharedPreferences().setString(APNS_TOKEN, value);
AppSharedPreferences().setString(ONESIGNAL_APNS_TOKEN, value);
});
// voIPKit.getVoIPToken().then((value) {
// print('🎈 example: getVoIPToken: $value');
// AppSharedPreferences().setString(APNS_TOKEN, value!);
// // getOneSignalVOIPToken(value);
// });
}
print("Firebase Token: " + token!);
sharedPref.setString(PUSH_TOKEN, token!);
if (Platform.isIOS) {
FirebaseMessaging.instance.getAPNSToken().then((value) {
print("Push APNS getToken: " + value!);
AppSharedPreferences().setString(APNS_TOKEN, value);
AppSharedPreferences().setString(ONESIGNAL_APNS_TOKEN, value);
});
// voIPKit.getVoIPToken().then((value) {
// print('🎈 example: getVoIPToken: $value');
// AppSharedPreferences().setString(APNS_TOKEN, value!);
// // getOneSignalVOIPToken(value);
// });
}
if (token != null) {
DEVICE_TOKEN = token;
if (!projectViewModel.isLoginChild) {
@ -346,7 +322,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
startZoom();
// HMG_Geofencing(context).loadZones().then((instance) => instance.init());
}
void startZoom(){
void startZoom() {
var zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig(
domain: "zoom.us",
@ -476,20 +453,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
getNotificationCount(token) async {
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService.getDashboard().then((value) => {
if (value != null)
{
setState(() {
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
@ -519,11 +490,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
getText(currentTab).toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: currentTab == 0
? CustomColors.backgroudGreyColor
: Theme.of(context).textTheme.headline1!.color,
fontFamily:
projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1!.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// bold: true,
),
leading: Builder(
@ -532,14 +500,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: <Widget>[
currentTab == 0
? IconButton(
icon: SvgPicture.asset(
"assets/images/new/menu.svg"),
color: Theme.of(context)
.textTheme
.headline1!
.color,
onPressed: () =>
Scaffold.of(context).openDrawer(),
icon: SvgPicture.asset("assets/images/new/menu.svg"),
color: Theme.of(context).textTheme.headline1!.color,
onPressed: () => Scaffold.of(context).openDrawer(),
)
: IconButton(
icon: Icon(Icons.arrow_back),
@ -550,9 +513,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController.jumpToPage(0);
},
),
projectViewModel.isLogin &&
model.notificationsCount != null &&
!projectViewModel.isLoginChild
projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild
? Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
@ -570,8 +531,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
model.notificationsCount.toString(),
style: TextStyle(
color: Colors.white,
fontSize:
projectViewModel.isArabic ? 8 : 9,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
@ -655,16 +615,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
index: currentTab,
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton:
(projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton(
elevation: true,
onTap: () {
changeCurrentTab(2);
projectViewModel.analytics.appointment.book_appointment();
},
)
: null);
floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton(
elevation: true,
onTap: () {
changeCurrentTab(2);
projectViewModel.analytics.appointment.book_appointment();
},
)
: null);
}
triggerRobot() {
@ -692,22 +651,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
await PushNotificationHandler.getInstance().requestPermissions();
// authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value));
if (authenticatedUserObject.isLogin) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {});
authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {});
authService.getDashboard().then((value) async {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
if (value != null && value['List_PatientDashboard'].length != 0) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(int.parse(notificationCount));

@ -322,15 +322,17 @@ class _clinic_listState extends State<ClinicList> {
String pharmaLiveCareQRCodeValue = widget.pharmacyLiveCareQRCode;
Navigator.push(
context,
FadePage(
page: PaymentMethod(
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {});
},
patientShare: num.parse(getERAppointmentFeesList.total!),
isFromAdvancePayment: widget.isPharmacyLiveCare,
))).then((value) {
),
),
).then((value) {
if (value != null) {
selectedPaymentMethod = value[0];
print(value);
@ -413,28 +415,28 @@ class _clinic_listState extends State<ClinicList> {
service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async {
if (res["MessageStatus"] == 1) {
await localContext!.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
GifLoaderDialogUtils.hideDialog(localContext!);
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
GifLoaderDialogUtils.hideDialog(localContext!);
log("Payfort: ${successResult.responseMessage}");
await localContext!.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
GifLoaderDialogUtils.hideDialog(localContext!);
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
GifLoaderDialogUtils.hideDialog(localContext!);
log("Payfort: ${successResult.responseMessage}");
await localContext!.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");

@ -334,6 +334,58 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> insertWalkInAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
Request req = appGlobal.getPublicRequest();
request = {
"IsForLiveCare": false,
"ProjectID": projectID,
"ClinicID": clinicID,
"DoctorID": docID,
"StartTime": selectedTime,
"SelectedTime": selectedTime,
"EndTime": selectedTime,
"InitialSlotDuration": initialSlotDuration,
"StrAppointmentDate": selectedDate,
"IsVirtual": false,
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"BookedBy": 102,
"VisitType": 1,
"VisitFor": 1,
"GenderID": authUser.gender,
"Age": authUser.age != null ? authUser.age : 0,
"VersionID": req.VersionID,
"Channel": req.Channel,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
try {
await baseAppClient.post(INSERT_WALKIN_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
} catch (e) {
return Future.error(e);
}
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context,
[String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> request;
@ -615,6 +667,32 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientShareForWalkInAppointment(int clinicID, int projectID, int doctorID) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "ClinicID": clinicID, "DoctorID": doctorID};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE_FOR_WALKIN_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> canPayForWalkInAppointment(int clinicID, int projectID, int doctorID) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "ClinicID": clinicID, "DoctorID": doctorID, "StartTime": "12:00", "EndTime": "12:00"};
dynamic localRes;
await baseAppClient.post(CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false, isForUpcomming = false, IsForArrived = false}) async {
Map<String, dynamic> request;
@ -1548,6 +1626,19 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> checkScannedNFCAndQRCode(String nfcCode, int projectId) async {
Map<String, dynamic> request;
request = {"NFC_Code": nfcCode, "ProjectID": projectId};
dynamic localRes;
await baseAppClient.post(CHECK_SCANNED_NFC_QR_CODE, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> checkIfHasDentalPlan(int projectID, BuildContext context) async {
Map<String, dynamic> request;

@ -2963,6 +2963,13 @@ class TranslationBase {
String get selectHospitalBloodDonation => localizedValues["selectHospitalBloodDonation"][locale.languageCode];
String get wecare => localizedValues["wecare"][locale.languageCode];
String get myinstructions => localizedValues["myinstructions"][locale.languageCode];
String get waitingAppointment => localizedValues["waitingAppointment"][locale.languageCode];
String get whatWaitingAppointment => localizedValues["whatWaitingAppointment"][locale.languageCode];
String get waitingAppointmentText1 => localizedValues["waitingAppointmentText1"][locale.languageCode];
String get waitingAppointmentText2 => localizedValues["waitingAppointmentText2"][locale.languageCode];
String get waitingAppointmentText3 => localizedValues["waitingAppointmentText3"][locale.languageCode];
String get waitingAppointmentVerificationMethod => localizedValues["waitingAppointmentVerificationMethod"][locale.languageCode];
String get howToUseVerificationMethod => localizedValues["howToUseVerificationMethod"][locale.languageCode];
}

@ -155,9 +155,9 @@ class _AppDrawerState extends State<AppDrawer> {
height: 1,
),
),
mHeight(20.0),
mHeight(10.0),
(user != null && projectProvider!.isLogin)
? Image.network("https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${user!.patientID.toString()}", fit: BoxFit.fill, height: 73.5, width: 73.5)
? Image.network("https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${user!.patientID.toString()}", fit: BoxFit.fill, height: 70, width: 70)
: Container(),
],
),
@ -705,7 +705,7 @@ class _AppDrawerState extends State<AppDrawer> {
// result.list.cRSVerificationStatus = result['CRSVerificationStatus'];
await this.sharedPref.setString(APP_LANGUAGE, currentLang);
await this.sharedPref.setString(BLOOD_TYPE, bloodType);
await this.sharedPref.setInt(LAST_LOGIN, loginType ?? 1 );
await this.sharedPref.setInt(LAST_LOGIN, loginType ?? 1);
await this.sharedPref.setObject(MAIN_USER, mainUser);
await this.sharedPref.setObject(USER_PROFILE, result.list);
await this.sharedPref.setObject(FAMILY_FILE, familyFile);

@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS
@ -343,7 +343,7 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PROJECT_ID_VALUE', projId);
form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod);
form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamaralive/Home/Checkout");
form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamara/Home/Checkout");
form = form.replaceFirst('INSTALLMENTS_VALUE', installments);
form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo!);

Loading…
Cancel
Save