Merge branch 'development_v3.3' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

# Conflicts:
#	lib/config/config.dart
#	lib/core/model/labs/patient_lab_orders.dart
#	lib/core/model/labs/request_patient_lab_special_result.dart
#	lib/core/model/labs/request_send_lab_report_email.dart
#	lib/core/model/radiology/final_radiology.dart
#	lib/core/model/radiology/request_send_rad_report_email.dart
#	lib/core/model/rate/appoitment_rated.dart
#	lib/core/service/client/base_app_client.dart
#	lib/core/service/medical/labs_service.dart
#	lib/core/service/medical/radiology_service.dart
#	lib/core/viewModels/medical/labs_view_model.dart
#	lib/core/viewModels/medical/radiology_view_model.dart
#	lib/models/Authentication/check_activation_code_request.dart
#	lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart
#	lib/pages/BookAppointment/BookSuccess.dart
#	lib/pages/BookAppointment/QRCode.dart
#	lib/pages/DrawerPages/family/my-family.dart
#	lib/pages/DrawerPages/notifications/notification_details_page.dart
#	lib/pages/MyAppointments/AppointmentDetails.dart
#	lib/pages/MyAppointments/MyAppointments.dart
#	lib/pages/MyAppointments/widgets/AppointmentActions.dart
#	lib/pages/ToDoList/ToDo.dart
#	lib/pages/landing/landing_page.dart
#	lib/pages/livecare/widgets/clinic_list.dart
#	lib/pages/login/confirm-login.dart
#	lib/pages/login/login.dart
#	lib/pages/medical/labs/laboratory_result_page.dart
#	lib/pages/medical/radiology/radiology_details_page.dart
#	lib/services/authentication/auth_provider.dart
#	lib/splashPage.dart
#	lib/uitl/push-notification-handler.dart
#	lib/widgets/drawer/app_drawer_widget.dart
dev_v3.13.6_voipcall
Sultan khan 2 years ago
commit 4338da513d

@ -339,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 11.3; var VERSION_ID = 11.5;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;

@ -791,7 +791,7 @@ const Map localizedValues = {
"Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.", "Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.",
"ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." "ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية."
}, },
"language-setting": {"en": "SMS and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة و الاتصال الآلي"}, "language-setting": {"en": "SMS, WhatsApp and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة والواتس اب وتأكيد المكالمات"},
"alert": {"en": "Alerts", "ar": "التنبيهات"}, "alert": {"en": "Alerts", "ar": "التنبيهات"},
"email-alert": {"en": "Alert by Email", "ar": "استلام التنبيهات بالبريد الالكتروني"}, "email-alert": {"en": "Alert by Email", "ar": "استلام التنبيهات بالبريد الالكتروني"},
"sms-alert": {"en": "Alert by SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"}, "sms-alert": {"en": "Alert by SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"},

@ -43,3 +43,4 @@ const CLINICS_LIST = 'CLINICS_LIST';
const COVID_QA_LIST = 'COVID_QA_LIST'; const COVID_QA_LIST = 'COVID_QA_LIST';
const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN'; const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN';
const REGISTER_INFO_DUBAI ='register-info-dubai'; const REGISTER_INFO_DUBAI ='register-info-dubai';
const IS_LAST_APPOINTMENT_RATE_SHOWN ='is-last-appointment-rate-shown';

@ -17,6 +17,7 @@ class PatientLabOrders {
String? genderDescription; String? genderDescription;
String? invoiceNo; String? invoiceNo;
String? invoiceNo_VP; String? invoiceNo_VP;
String? invoiceType;
bool? isActiveDoctorProfile; bool? isActiveDoctorProfile;
bool? isDoctorAllowVedioCall; bool? isDoctorAllowVedioCall;
bool? isExecludeDoctor; bool? isExecludeDoctor;
@ -69,8 +70,10 @@ class PatientLabOrders {
this.projectNameN, this.projectNameN,
this.qR, this.qR,
this.setupID, this.setupID,
this.invoiceNo_VP, this.invoiceNo_VP,
this.speciality,this.isLiveCareAppointment}); this.invoiceType,
this.speciality,
this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
@ -106,8 +109,9 @@ class PatientLabOrders {
qR = json['QR']; qR = json['QR'];
setupID = json['SetupID']; setupID = json['SetupID'];
invoiceNo_VP = json['invoiceNo_VP']; invoiceNo_VP = json['invoiceNo_VP'];
invoiceType = json['InvoiceType'];
isLiveCareAppointment = json['IsLiveCareAppointment']; isLiveCareAppointment = json['IsLiveCareAppointment'];
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -146,7 +150,7 @@ class PatientLabOrders {
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality; data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment; data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['invoiceNo_VP'] =this.invoiceNo_VP; data['invoiceNo_VP'] = this.invoiceNo_VP;
return data; return data;
} }
} }
@ -155,8 +159,7 @@ class PatientLabOrdersList {
String? filterName = ""; String? filterName = "";
List<PatientLabOrders> patientLabOrdersList = []; List<PatientLabOrders> patientLabOrdersList = [];
PatientLabOrdersList( PatientLabOrdersList({this.filterName, required PatientLabOrders patientDoctorAppointment}) {
{this.filterName, PatientLabOrders? patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment);
patientLabOrdersList.add(patientDoctorAppointment!);
} }
} }

@ -1,6 +1,7 @@
class RequestPatientLabSpecialResult { class RequestPatientLabSpecialResult {
String? invoiceNo; String? invoiceNo;
String? invoiceNoVP; String? invoiceNoVP;
String? invoiceType;
String? orderNo; String? orderNo;
String? setupID; String? setupID;
String? projectID; String? projectID;
@ -22,27 +23,29 @@ class RequestPatientLabSpecialResult {
RequestPatientLabSpecialResult( RequestPatientLabSpecialResult(
{this.invoiceNo, {this.invoiceNo,
this.invoiceNoVP, this.invoiceNoVP,
this.orderNo, this.invoiceType,
this.setupID, this.orderNo,
this.projectID, this.setupID,
this.clinicID, this.projectID,
this.versionID, this.clinicID,
this.channel, this.versionID,
this.languageID, this.channel,
this.iPAdress, this.languageID,
this.generalid, this.iPAdress,
this.patientOutSA, this.generalid,
this.sessionID, this.patientOutSA,
this.isDentalAllowedBackend, this.sessionID,
this.deviceTypeID, this.isDentalAllowedBackend,
this.patientID, this.deviceTypeID,
this.tokenID, this.patientID,
this.patientTypeID, this.tokenID,
this.patientType}); this.patientTypeID,
this.patientType});
RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) { RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo = json['InvoiceNo_VP']; invoiceNo = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
setupID = json['SetupID']; setupID = json['SetupID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
@ -66,6 +69,7 @@ class RequestPatientLabSpecialResult {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP; data['InvoiceNo_VP'] = this.invoiceNoVP;
data['InvoiceType'] = this.invoiceType;
data['OrderNo'] = this.orderNo; data['OrderNo'] = this.orderNo;
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;

@ -24,6 +24,7 @@ class RequestSendLabReportEmail {
String? projectID; String? projectID;
String? invoiceNo; String? invoiceNo;
String? invoiceNoVP; String? invoiceNoVP;
String? invoiceType;
String? orderDate; String? orderDate;
String? orderNo; String? orderNo;
bool? isDownload; bool? isDownload;
@ -55,6 +56,7 @@ class RequestSendLabReportEmail {
this.projectID, this.projectID,
this.invoiceNo, this.invoiceNo,
this.invoiceNoVP, this.invoiceNoVP,
this.invoiceType,
this.orderDate, this.orderDate,
this.orderNo, this.orderNo,
this.isDownload, this.isDownload,
@ -86,6 +88,7 @@ class RequestSendLabReportEmail {
projectID = json['ProjectID']; projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNoVP = json['InvoiceNo_VP']; invoiceNoVP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
isDownload = json['IsDownload']; isDownload = json['IsDownload'];
@ -119,6 +122,7 @@ class RequestSendLabReportEmail {
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP; data['InvoiceNo_VP'] = this.invoiceNoVP;
data['InvoiceType'] = this.invoiceType;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo; data['OrderNo'] = this.orderNo;
data['IsDownload'] = this.isDownload; data['IsDownload'] = this.isDownload;

@ -7,6 +7,7 @@ class FinalRadiology {
int? invoiceLineItemNo; int? invoiceLineItemNo;
int? invoiceNo; int? invoiceNo;
dynamic invoiceNo_VP; dynamic invoiceNo_VP;
String? invoiceType;
int? doctorID; int? doctorID;
int? clinicID; int? clinicID;
DateTime? orderDate; DateTime? orderDate;
@ -51,6 +52,7 @@ class FinalRadiology {
this.invoiceLineItemNo, this.invoiceLineItemNo,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP, this.invoiceNo_VP,
this.invoiceType,
this.doctorID, this.doctorID,
this.clinicID, this.clinicID,
this.orderDate, this.orderDate,
@ -96,6 +98,7 @@ class FinalRadiology {
invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP']; invoiceNo_VP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
orderDate = DateUtil.convertStringToDate(json['OrderDate']); orderDate = DateUtil.convertStringToDate(json['OrderDate']);
@ -145,6 +148,7 @@ class FinalRadiology {
data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP; data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['InvoiceType'] = this.invoiceType;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;

@ -7,6 +7,7 @@ class RequestSendRadReportEmail {
String? generalid; String? generalid;
int? invoiceNo; int? invoiceNo;
int? invoiceNo_VP; int? invoiceNo_VP;
String? invoiceType;
String? iPAdress; String? iPAdress;
bool? isDentalAllowedBackend; bool? isDentalAllowedBackend;
int? languageID; int? languageID;
@ -30,32 +31,33 @@ class RequestSendRadReportEmail {
RequestSendRadReportEmail( RequestSendRadReportEmail(
{this.channel, {this.channel,
this.clinicName, this.clinicName,
this.dateofBirth, this.dateofBirth,
this.deviceTypeID, this.deviceTypeID,
this.doctorName, this.doctorName,
this.generalid, this.generalid,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP, this.invoiceNo_VP,
this.iPAdress, this.invoiceType,
this.isDentalAllowedBackend, this.iPAdress,
this.languageID, this.isDentalAllowedBackend,
this.orderDate, this.languageID,
this.patientID, this.orderDate,
this.patientIditificationNum, this.patientID,
this.patientMobileNumber, this.patientIditificationNum,
this.patientName, this.patientMobileNumber,
this.patientOutSA, this.patientName,
this.patientType, this.patientOutSA,
this.patientTypeID, this.patientType,
this.projectID, this.patientTypeID,
this.projectName, this.projectID,
this.radResult, this.projectName,
this.sessionID, this.radResult,
this.setupID, this.sessionID,
this.to, this.setupID,
this.tokenID, this.to,
this.versionID}); this.tokenID,
this.versionID});
RequestSendRadReportEmail.fromJson(Map<String, dynamic> json) { RequestSendRadReportEmail.fromJson(Map<String, dynamic> json) {
channel = json['Channel']; channel = json['Channel'];
@ -66,6 +68,7 @@ class RequestSendRadReportEmail {
generalid = json['generalid']; generalid = json['generalid'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP']; invoiceNo_VP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
isDentalAllowedBackend = json['isDentalAllowedBackend']; isDentalAllowedBackend = json['isDentalAllowedBackend'];
languageID = json['LanguageID']; languageID = json['LanguageID'];
@ -98,6 +101,7 @@ class RequestSendRadReportEmail {
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP; data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['InvoiceType'] = this.invoiceType;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['LanguageID'] = this.languageID; data['LanguageID'] = this.languageID;

@ -8,8 +8,10 @@ class AppointmentRateService extends BaseService {
List<AppoitmentRated> appointmentRatedList =[]; List<AppoitmentRated> appointmentRatedList =[];
AppointmentDetails? appointmentDetails; AppointmentDetails? appointmentDetails;
Future getIsLastAppointmentRatedList() async { Future getIsLastAppointmentRatedList(int languageID) async {
hasError = false; hasError = false;
Map<String, dynamic> bodyData = Map();
bodyData['LanguageID'] = languageID;
await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) {
appointmentRatedList.clear(); appointmentRatedList.clear();
response['IsLastAppoitmentRatedList'].forEach((appoint) { response['IsLastAppoitmentRatedList'].forEach((appoint) {
@ -18,7 +20,7 @@ class AppointmentRateService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: Map()); }, body: bodyData);
} }
Future getAppointmentDetails() async { Future getAppointmentDetails() async {

@ -73,14 +73,29 @@ class BaseAppClient {
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = (languageID == 'ar' ? 1 : 2);
if (body.containsKey('LanguageID')) {
if(body['LanguageID'] != null) {
body['LanguageID'] = body['LanguageID'];
} else {
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
} else {
// body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2);
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
// body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
// body['isVidaPlus'] = true; // body['isVidaPlus'] = true;
body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); double? lat = await AppSharedPreferences().getDouble(USER_LAT);
body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); double? long = await AppSharedPreferences().getDouble(USER_LONG);
body['Latitude'] = lat == null ? 0.0 : lat;
body['Longitude'] = long == null ? 0.0 : long;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
@ -90,7 +105,11 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isIOS ? 1 : await Utils.isGoogleServicesAvailable() ? 2 : 3; body['DeviceTypeID'] = Platform.isIOS
? 1
: await Utils.isGoogleServicesAvailable()
? 2
: 3;
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
// if (!body.containsKey('PatientType')) { // if (!body.containsKey('PatientType')) {
@ -150,7 +169,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body['PatientID'] = 4767370; //3844083 // body['PatientID'] = 1231755; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574

@ -34,7 +34,7 @@ class LabsService extends BaseService {
List<LabResult> labResultList = []; List<LabResult> labResultList = [];
List<LabOrderResult> labOrdersResultsList = []; List<LabOrderResult> labOrdersResultsList = [];
Future getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, String? setupID, bool? isVidaPlus}) async { Future getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? invoiceType, String? orderNo, String? setupID, bool? isVidaPlus}) async {
hasError = false; hasError = false;
_requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.clinicID = clinicID;
@ -42,6 +42,8 @@ class LabsService extends BaseService {
_requestPatientLabSpecialResult.invoiceNo = isVidaPlus! ? "0" : invoiceNo; _requestPatientLabSpecialResult.invoiceNo = isVidaPlus! ? "0" : invoiceNo;
_requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0"; _requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0";
_requestPatientLabSpecialResult.invoiceType = invoiceType!;
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
_requestPatientLabSpecialResult.setupID = setupID; _requestPatientLabSpecialResult.setupID = setupID;
@ -61,6 +63,7 @@ class LabsService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo_VP'] = isVidaPlus! ? patientLabOrder!.invoiceNo : "0"; body['InvoiceNo_VP'] = isVidaPlus! ? patientLabOrder!.invoiceNo : "0";
body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder!.invoiceNo; body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder!.invoiceNo;
body['InvoiceType'] = patientLabOrder!.invoiceType;
body['OrderNo'] = patientLabOrder!.orderNo; body['OrderNo'] = patientLabOrder!.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
@ -205,6 +208,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectID = patientLabOrder!.projectID; _requestSendLabReportEmail.projectID = patientLabOrder!.projectID;
_requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0"; _requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0";
_requestSendLabReportEmail.invoiceType = patientLabOrder.invoiceType;
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = userObj!.firstName! + " " + userObj.lastName!; _requestSendLabReportEmail.patientName = userObj!.firstName! + " " + userObj.lastName!;

@ -10,13 +10,14 @@ class RadiologyService extends BaseService {
bool isRadiologyVIDAPlus = false; bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int? invoiceNo, int? lineItem, int? projectId, bool? isVidaPlus}) async { Future getRadImageURL({int? invoiceNo, String? invoiceType, int? lineItem, int? projectId, bool? isVidaPlus}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = isVidaPlus! ? "0" : invoiceNo; body['InvoiceNo'] = isVidaPlus! ? "0" : invoiceNo;
body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0";
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
body['InvoiceType'] = invoiceType;
await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
url = response['Data']; url = response['Data'];
@ -79,6 +80,7 @@ class RadiologyService extends BaseService {
_requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.radResult = finalRadiology.reportData;
_requestSendRadReportEmail.to = userObj.emailAddress; _requestSendRadReportEmail.to = userObj.emailAddress;
_requestSendRadReportEmail.dateofBirth = userObj.dateofBirth; _requestSendRadReportEmail.dateofBirth = userObj.dateofBirth;
_requestSendRadReportEmail.invoiceType = finalRadiology.invoiceType;
hasError = false; hasError = false;
await baseAppClient.post(SEND_RAD_REPORT_EMAIL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(SEND_RAD_REPORT_EMAIL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {

@ -15,6 +15,7 @@ class PrivilegeService extends BaseService {
Future getPrivilege() async { Future getPrivilege() async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientType'] = 4; body['PatientType'] = 4;
body['LanguageID'] = 1;
await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) {
response['ServicePrivilegeList'].forEach((item) { response['ServicePrivilegeList'].forEach((item) {
privilegeModelList.add(PrivilegeModel.fromJson(item)); privilegeModelList.add(PrivilegeModel.fromJson(item));

@ -12,10 +12,10 @@ class AppointmentRateViewModel extends BaseViewModel {
AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails!; AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails!;
Future getIsLastAppointmentRatedList() async { Future getIsLastAppointmentRatedList(int languageID) async {
isHaveAppointmentNotRate = false; isHaveAppointmentNotRate = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _appointmentRateService.getIsLastAppointmentRatedList(); await _appointmentRateService.getIsLastAppointmentRatedList(languageID);
if (_appointmentRateService.hasError) { if (_appointmentRateService.hasError) {
error = _appointmentRateService.error!; error = _appointmentRateService.error!;
setState(ViewState.Error); setState(ViewState.Error);

@ -74,9 +74,15 @@ class LabsViewModel extends BaseViewModel {
List<LabResultList> labResultLists = []; List<LabResultList> labResultLists = [];
getLaboratoryResult({required String projectID, required int clinicID, required String invoiceNo, required String orderNo, required String setupID, required bool isVidaPlus}) async { getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? invoiceType, String? orderNo, String? setupID, bool? isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID, isVidaPlus: isVidaPlus); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,
invoiceType: invoiceType,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,
setupID: setupID,
isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error!; error = _labsService.error!;
setState(ViewState.Error); setState(ViewState.Error);

@ -48,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({required int invoiceNo, required int lineItem, required int projectId, required bool isVidaPlus}) async { getRadImageURL({required int invoiceNo, String? invoiceType, required int lineItem, required int projectId, required bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, invoiceType: invoiceType, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error!; error = _radiologyService.error!;
setState(ViewState.Error); setState(ViewState.Error);

@ -41,7 +41,7 @@ class CheckActivationCodeReq {
this.isSilentLogin, this.isSilentLogin,
this.versionID, this.versionID,
this.channel, this.channel,
this.languageID, // this.languageID,
this.iPAdress, this.iPAdress,
this.generalid, this.generalid,
this.patientOutSA, this.patientOutSA,
@ -68,7 +68,7 @@ class CheckActivationCodeReq {
isSilentLogin = json['IsSilentLogin']; isSilentLogin = json['IsSilentLogin'];
versionID = json['VersionID']; versionID = json['VersionID'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; // languageID = json['LanguageID'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
generalid = json['generalid']; generalid = json['generalid'];
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
@ -96,7 +96,7 @@ class CheckActivationCodeReq {
data['IsSilentLogin'] = this.isSilentLogin; data['IsSilentLogin'] = this.isSilentLogin;
data['VersionID'] = this.versionID; data['VersionID'] = this.versionID;
data['Channel'] = this.channel; data['Channel'] = this.channel;
data['LanguageID'] = this.languageID; // data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;

@ -1,7 +1,7 @@
class GetAllSharedRecordsByStatusReq { class GetAllSharedRecordsByStatusReq {
double? versionID; double? versionID;
int? channel; int? channel;
int? languageID; //int? languageID;
String? iPAdress; String? iPAdress;
String? generalid; String? generalid;
int? patientOutSA; int? patientOutSA;
@ -17,7 +17,7 @@ class GetAllSharedRecordsByStatusReq {
GetAllSharedRecordsByStatusReq( GetAllSharedRecordsByStatusReq(
{this.versionID, {this.versionID,
this.channel, this.channel,
this.languageID, // this.languageID,
this.iPAdress, this.iPAdress,
this.generalid, this.generalid,
this.patientOutSA, this.patientOutSA,
@ -33,7 +33,7 @@ class GetAllSharedRecordsByStatusReq {
GetAllSharedRecordsByStatusReq.fromJson(Map<String, dynamic> json) { GetAllSharedRecordsByStatusReq.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; // languageID = json['LanguageID'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
generalid = json['generalid']; generalid = json['generalid'];
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
@ -51,7 +51,7 @@ class GetAllSharedRecordsByStatusReq {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID; data['VersionID'] = this.versionID;
data['Channel'] = this.channel; data['Channel'] = this.channel;
data['LanguageID'] = this.languageID; // data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;

@ -159,27 +159,54 @@ class _BookSuccessState extends State<BookSuccess> {
Widget _getQRButtons() { Widget _getQRButtons() {
return Container( return Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.all(14),
height: MediaQuery.of(context).size.height * 0.18, height: MediaQuery.of(context).size.height * 0.18,
margin: EdgeInsets.only(bottom: 24),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
ButtonTheme( Row(
shape: RoundedRectangleBorder( children: [
borderRadius: BorderRadius.circular(10.0), Expanded(
), flex: 1,
minWidth: MediaQuery.of(context).size.width * 0.7, child: ButtonTheme(
height: 45.0, shape: RoundedRectangleBorder(
child: CustomTextButton( borderRadius: BorderRadius.circular(10.0),
backgroundColor: CustomColors.green, ),
elevation: 0, minWidth: MediaQuery.of(context).size.width * 0.7,
onPressed: () { height: 45.0,
// navigateToQR(context); child: CustomTextButton(
GifLoaderDialogUtils.showMyDialog(context); backgroundColor: CustomColors.green,
getAppoQR(context); elevation: 0,
}, onPressed: () {
child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), GifLoaderDialogUtils.showMyDialog(context);
), getAppoQR(context);
},
child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
),
mWidth(7),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () {
navigateToHome(context);
// GifLoaderDialogUtils.showMyDialog(context);
// getAppoQR(context);
},
child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
),
],
), ),
], ],
), ),

@ -62,13 +62,9 @@ class _QRCodeState extends State<QRCode> {
// _bytes = base64.decode(widget.appoQR.split(',').last); // _bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
FlutterNfcKit.nfcAvailability.then((value) { // WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
_supportsNFC = (value == NFCAvailability.available);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// startNFCScan(); // startNFCScan();
}); // });
super.initState(); super.initState();
} }
@ -77,7 +73,7 @@ class _QRCodeState extends State<QRCode> {
Future.delayed(const Duration(milliseconds: 500), () { Future.delayed(const Duration(milliseconds: 500), () {
showNfcReader(context, onNcfScan: (String nfcId) { showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId); sendNfcCheckInRequest(nfcId,2);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!); locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!);
}); });
}, onCancel: () { }, onCancel: () {
@ -90,7 +86,7 @@ class _QRCodeState extends State<QRCode> {
startQRCodeScan() async { startQRCodeScan() async {
String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent)); String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent));
if (onlineCheckInQRCode != "") { if (onlineCheckInQRCode != "") {
sendNfcCheckInRequest(onlineCheckInQRCode); sendNfcCheckInRequest(onlineCheckInQRCode, 2);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!); locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!);
} else {} } else {}
} }
@ -102,7 +98,7 @@ class _QRCodeState extends State<QRCode> {
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000; double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000;
print(dist); print(dist);
if (dist <= projectDetailListModel.geofenceRadius!) { if (dist <= projectDetailListModel.geofenceRadius!) {
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode!); sendNfcCheckInRequest(projectDetailListModel.checkInQrCode!,2);
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
} }
@ -113,6 +109,9 @@ class _QRCodeState extends State<QRCode> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
_context = context; _context = context;
FlutterNfcKit.nfcAvailability.then((value) {
_supportsNFC = (value == NFCAvailability.available);
});
List<Widget> checkInOptionsList = getCheckInOptionsList(context); List<Widget> checkInOptionsList = getCheckInOptionsList(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).onlineCheckIn, appBarTitle: TranslationBase.of(context).onlineCheckIn,
@ -160,7 +159,8 @@ class _QRCodeState extends State<QRCode> {
onTap: () { onTap: () {
showNfcReader(context, onNcfScan: (String nfcId) { showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId); sendNfcCheckInRequest(nfcId, 2);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!); locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!);
}); });
}, onCancel: () { }, onCancel: () {
@ -242,8 +242,10 @@ class _QRCodeState extends State<QRCode> {
optionsList.add( optionsList.add(
InkWell( InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(80)) { if (projectViewModel.havePrivilege(80) && _supportsNFC) {
startNFCScan(); startNFCScan();
} else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
} }
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
@ -377,12 +379,12 @@ class _QRCodeState extends State<QRCode> {
return docSpeciality; return docSpeciality;
} }
sendNfcCheckInRequest(String nfcId) { sendNfcCheckInRequest(String nfcId, int checkInBy) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.sendCheckinNfcRequest(widget.patientShareResponse!.appointmentNo!, nfcId, widget.patientShareResponse!.projectID!, context).then((res) { service.sendCheckinNfcRequest(widget!.patientShareResponse!.appointmentNo!, nfcId, widget.patientShareResponse!.projectID!, checkInBy, context).then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -426,10 +426,11 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
} }
getCurrentLanguage() async { getCurrentLanguage() async {
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); this.language = projectViewModel.isArabic ? "ar" : "en";
setState(() { // var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
this.language = languageID; // setState(() {
}); // this.language = languageID;
// });
} }
} }

@ -456,15 +456,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
switchUser(user, context) { switchUser(user, context) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
// this // this
// .familyFileProvider // .familyFileProvider
// .silentLoggin(user) // .silentLoggin(user)
// .then((value) => loginAfter(value, context)); // .then((value) => loginAfter(value, context));
// Utils.showProgressDialog(context); // Utils.showProgressDialog(context);
this.familyFileProvider.silentLoggin(user, mainUser: user).then((value) { this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) {
loginAfter(value, context);
}).catchError((err) {
print("err:$err"); print("err:$err");
AppToast.showErrorToast(message: err.toString()); AppToast.showErrorToast(message: err.toString());
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -560,7 +559,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
try { try {
if (familySharedRecords == null) { if (familySharedRecords == null) {
familySharedRecords = await familyFileProvider.getSharedRecordByStatus(); int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID);
} }
sentRecordsList = []; sentRecordsList = [];
familySharedRecordsList = []; familySharedRecordsList = [];

@ -81,6 +81,16 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
letterSpacing: -0.64, letterSpacing: -0.64,
), ),
), ),
SizedBox(height: 18),
Text(
widget.notification!.message!.trim(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.48,
),
),
if (widget.notification.notificationType == "2") if (widget.notification.notificationType == "2")
Padding( Padding(
padding: const EdgeInsets.only(top: 18), padding: const EdgeInsets.only(top: 18),
@ -105,15 +115,24 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
}, fit: BoxFit.fill), }, fit: BoxFit.fill),
), ),
SizedBox(height: 18), SizedBox(height: 18),
Text( // Text(
widget.notification.message!.trim(), // widget.notification.message!.trim(),
style: TextStyle( // style: TextStyle(
fontSize: 12, // fontSize: 12,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
color: Color(0xff575757), // color: Color(0xff575757),
letterSpacing: -0.48, // letterSpacing: -0.48,
), // ),
), // ),
// Text(
// widget.notification.message.trim(),
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.w600,
// color: Color(0xff575757),
// letterSpacing: -0.48,
// ),
// ),
], ],
), ),
); );

@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -52,6 +54,8 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
int _currentPage = 0; int _currentPage = 0;
ToDoCountProviderModel? toDoProvider;
@override @override
void initState() { void initState() {
filterType = FilterType.Clinic; filterType = FilterType.Clinic;
@ -72,6 +76,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myAppointmentsList, appBarTitle: TranslationBase.of(context).myAppointmentsList,
isShowAppBar: true, isShowAppBar: true,
@ -168,6 +173,19 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}); });
getToDoCount();
}
getToDoCount() {
toDoProvider!.setState(0, true, "0");
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider!.setState(res['AppointmentActiveNumber'], true, "0");
} else {}
}).catchError((err) {
print(err);
});
} }
bool isConfirmed(AppoitmentAllHistoryResultList appo) { bool isConfirmed(AppoitmentAllHistoryResultList appo) {
@ -378,9 +396,9 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
isLiveCareAppointment: _appointmentResult.isLiveCareAppointment, isLiveCareAppointment: _appointmentResult.isLiveCareAppointment,
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate!), date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate!),
isSortByClinic: _isSortByClinic, isSortByClinic: _isSortByClinic,
rating: _appointmentResult.actualDoctorRate! + 0.0, rating: _appointmentResult.actualDoctorRate + 0.0,
appointmentTime: _appointmentResult.isLiveCareAppointment appointmentTime: _appointmentResult.isLiveCareAppointment!
! ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate!).toString().split(" ")[1].substring(0, 5) ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5)
: _appointmentResult.startTime!.substring(0, 5), : _appointmentResult.startTime!.substring(0, 5),
// appointmentTime: _appointmentResult.startTime.substring(0, 5), // appointmentTime: _appointmentResult.startTime.substring(0, 5),
remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)

@ -30,19 +30,19 @@ class BookedButtonsAllowCheckIn {
{ {
"title": TranslationBase.of(AppGlobal.context).add, "title": TranslationBase.of(AppGlobal.context).add,
"subtitle": TranslationBase.of(AppGlobal.context).reminder, "subtitle": TranslationBase.of(AppGlobal.context).reminder,
"icon": "reminder_icon.png", "icon": "assets/images/new-design/reminder_icon.png",
"caller": "addReminder", "caller": "addReminder",
}, },
{ {
"title": TranslationBase.of(AppGlobal.context).hospital, "title": TranslationBase.of(AppGlobal.context).hospital,
"subtitle": TranslationBase.of(AppGlobal.context).location, "subtitle": TranslationBase.of(AppGlobal.context).location,
"icon": "location_icon.png", "icon": "assets/images/new-design/location_icon.png",
"caller": "navigateToProject", "caller": "navigateToProject",
}, },
{ {
"title": TranslationBase.of(AppGlobal.context).online, "title": TranslationBase.of(AppGlobal.context).online,
"subtitle": TranslationBase.of(AppGlobal.context).payment, "subtitle": TranslationBase.of(AppGlobal.context).payment,
"icon": "check-in.png", "icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList", "caller": "goToTodoList",
} }
]; ];

@ -99,6 +99,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
hasBadge: true, hasBadge: true,
isEnable: !shouldEnable, isEnable: !shouldEnable,
imgColor: Color(0xff28323A), imgColor: Color(0xff28323A),
isPngImage: appoButtonsList[index].icon!.contains(".png") ? true : false,
), ),
); );
}, },
@ -481,8 +482,12 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID!, context).then((res) { service.isAllowedToAskDoctor(widget.appo.doctorID!,languageID, context).then((res) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { if (res['PatientDoctorAppointmentResultList'].length != 0) {
@ -495,12 +500,14 @@ class _AppointmentActionsState extends State<AppointmentActions> {
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}); });
} });
}
getCallRequestType() { getCallRequestType() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) { service.getCallRequestType(languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
List<AskDocRequestType> requestData = []; List<AskDocRequestType> requestData = [];
res['ListReqTypes'].forEach((element) { res['ListReqTypes'].forEach((element) {
@ -543,9 +550,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
sendAskDocRequest(int requestType) { sendAskDocRequest(int requestType) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.sendAskDocCallRequest(widget.appo, requestType.toString(), context).then((res) {
service.sendAskDocCallRequest(widget.appo, requestType.toString(), languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully"); AppToast.showSuccessToast(message: "Request Sent Successfully");
@ -621,33 +630,34 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
} }
getPatientAppointmentHistoryWithAppo() {
getPatientAppointmentHistoryWithAppo() { GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService();
DoctorsListService service = new DoctorsListService(); int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) { service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo, languageID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]);
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ToDo( page: ToDo(
isShowAppBar: true, isShowAppBar: true,
isFromMyAppointments: true, isFromMyAppointments: true,
appointment: appo, appointment: appo,
),
), ),
), );
); } else {
} else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); }
} }).catchError((err) {
}).catchError((err) { print(err);
print(err); GifLoaderDialogUtils.hideDialog(context);
GifLoaderDialogUtils.hideDialog(context); err != null ?? AppToast.showErrorToast(message: err);
err != null ?? AppToast.showErrorToast(message: err); });
}); }
}
rateAppointment() { rateAppointment() {
widget.browser = new MyInAppBrowser(); widget.browser = new MyInAppBrowser();
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';

@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -50,9 +51,8 @@ class ToDo extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = []; List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = []; List<OBGyneProcedureListResponse> obGyneAppoList = [];
late var languageID; var languageID;
late MyInAppBrowser browser; MyInAppBrowser? browser;
bool isShowAppBar = true; bool isShowAppBar = true;
Function()? onBackClick; Function()? onBackClick;
bool isFromMyAppointments; bool isFromMyAppointments;
@ -84,6 +84,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool isInsured = false; bool isInsured = false;
bool isEligible = false; bool isEligible = false;
bool isCash = false; bool isCash = false;
MyInAppBrowser? browser;
@override @override
void initState() { void initState() {
@ -877,7 +878,19 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err); err != null ?? AppToast.showErrorToast(message: err);
}); });
// getAncillaryOrders(); getToDoCount();
}
getToDoCount() {
toDoProvider.setState(0, true, "0");
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {}
}).catchError((err) {
print(err);
});
} }
checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) { checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) {
@ -999,23 +1012,23 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
patientShareResponse.projectID = appo.projectID; patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup; patientShareResponse.isFollowup = appo.isFollowup;
FlutterNfcKit.nfcAvailability.then((value) { // FlutterNfcKit.nfcAvailability.then((value) {
if (value == NFCAvailability.available) { // if (value == NFCAvailability.available) {
PatientShareResponse patientShareResponse = new PatientShareResponse(); // PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj; patientShareResponse.doctorNameObj = appo.doctorNameObj;
patientShareResponse.doctorSpeciality = appo.doctorSpeciality; patientShareResponse.doctorSpeciality = appo.doctorSpeciality;
patientShareResponse.projectName = appo.projectName; patientShareResponse.projectName = appo.projectName;
patientShareResponse.appointmentDate = appo.appointmentDate; patientShareResponse.appointmentDate = appo.appointmentDate;
patientShareResponse.appointmentNo = appo.appointmentNo; patientShareResponse.appointmentNo = appo.appointmentNo;
patientShareResponse.clinicID = appo.clinicID; patientShareResponse.clinicID = appo.clinicID;
patientShareResponse.projectID = appo.projectID; patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup; patientShareResponse.isFollowup = appo.isFollowup;
navigateToQR(context, "", patientShareResponse, appo); navigateToQR(context, "", patientShareResponse, appo);
projectViewModel.analytics.todoList.to_do_list_check_in(appo); projectViewModel.analytics.todoList.to_do_list_check_in(appo);
} else { // } else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); // Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
} // }
}); // });
projectViewModel.analytics.todoList.to_do_list_check_in(appo); projectViewModel.analytics.todoList.to_do_list_check_in(appo);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
@ -1069,7 +1082,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
openPayment(paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { openPayment(paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser( browser?.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!),
@ -1080,7 +1093,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser.firstName!, authenticatedUser.firstName!,
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
widget.browser, widget!.browser!,
appo.isLiveCareAppointment!, appo.isLiveCareAppointment!,
"2", "2",
appo.isLiveCareAppointment! ? widget.patientShareResponse.clinicID.toString() : "", appo.isLiveCareAppointment! ? widget.patientShareResponse.clinicID.toString() : "",
@ -1111,7 +1124,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
// if(selectedPaymentMethod != "TAMARA") { // if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); browser?.close();
MyInAppBrowser.isPaymentDone = true; MyInAppBrowser.isPaymentDone = true;
return; return;
} }
@ -1121,7 +1134,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
// if(selectedPaymentMethod != "TAMARA") { // if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); browser?.close();
MyInAppBrowser.isPaymentDone = false; MyInAppBrowser.isPaymentDone = false;
return; return;
} }

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -17,6 +18,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart'; import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
@ -36,6 +38,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -70,6 +73,7 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver { class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var authProvider = new AuthProvider(); var authProvider = new AuthProvider();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
int currentTab = 0; int currentTab = 0;
late PageController pageController; late PageController pageController;
@ -275,7 +279,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus(); int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familyFileProvider.getSharedRecordByStatus(languageID);
} }
}); });
@ -347,7 +352,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);
@ -620,7 +625,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void checkUserStatus(token) async { void checkUserStatus(token) async {
await PushNotificationHandler.getInstance().requestPermissions(); await PushNotificationHandler.getInstance().requestPermissions();
authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value));
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) { if (data != null) {

@ -103,25 +103,25 @@ class _clinic_listState extends State<ClinicList> {
}); });
} }
}); });
getLanguageID();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
getLanguageID();
return Container( return Container(
child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(), child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(),
); );
} }
void startLiveCare() { void startLiveCare() {
int languageID = projectViewModel.isArabic ? 1 : 2;
bool isError = false; bool isError = false;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse();
service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['HasAppointment'] == true) { if (res['HasAppointment'] == true) {
isError = true; isError = true;
@ -184,9 +184,10 @@ class _clinic_listState extends State<ClinicList> {
} }
getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) {
int languageID = projectViewModel.isArabic ? 1 : 2;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) { }).catchError((err) {
@ -505,7 +506,8 @@ class _clinic_listState extends State<ClinicList> {
} }
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); languageID = projectViewModel.isArabic ? "ar" : "en";
// languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
} }
getLiveCareClinicsList() { getLiveCareClinicsList() {
@ -758,11 +760,12 @@ class _clinic_listState extends State<ClinicList> {
} }
void startScheduleLiveCare() { void startScheduleLiveCare() {
int languageID = projectViewModel.isArabic ? 1 : 2;
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =[]; List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
service.getLiveCareScheduledDoctorList(context, selectedClinicID).then((res) { service.getLiveCareScheduledDoctorList(context, selectedClinicID, languageID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -602,6 +602,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
{ {
// if(widget.isDubai ==false){ // if(widget.isDubai ==false){
widget.changePageViewIndex!(1), widget.changePageViewIndex!(1),
// if(widget.isDubai ==false){
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
} }
} }
@ -744,37 +746,17 @@ class _ConfirmLogin extends State<ConfirmLogin> {
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
// getToDoCount(); GifLoaderDialogUtils.hideDialog(context);
appointmentRateViewModel getToDoCount();
.getIsLastAppointmentRatedList()
.then((value) => { Navigator.pushAndRemoveUntil(
getToDoCount(), context,
checkIfIsInPatient(), FadePage(
GifLoaderDialogUtils.hideDialog(AppGlobal.context), page: LandingPage(),
if (appointmentRateViewModel.isHaveAppointmentNotRate) ),
{ (r) => false);
Navigator.pushAndRemoveUntil( insertIMEI();
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
},
insertIMEI()
})
.catchError((err) {
print(err);
});
} }
loading(flag) { loading(flag) {

@ -359,9 +359,9 @@ class _Login extends State<Login> {
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
authenticatedUserObject.user = result.list; authenticatedUserObject.user = result.list;
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList(languageID)
.then((value) => { .then((value) => {
checkIfIsInPatient(), checkIfIsInPatient(),
getToDoCount(), getToDoCount(),
@ -410,7 +410,7 @@ class _Login extends State<Login> {
bool hasAdmissionRequest = false; bool hasAdmissionRequest = false;
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel; GetAdmissionInfoResponseModel getAdmissionInfoResponseModel;
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel; GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel;
ClinicListService service = new ClinicListService(); ClinicListService? service = new ClinicListService();
service.checkIfInPatientAPI(context).then((res) { service.checkIfInPatientAPI(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
isAdmitted = res['isAdmitted']; isAdmitted = res['isAdmitted'];

@ -705,7 +705,8 @@ class _RegisterInfo extends State<RegisterInfo> {
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) { int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) {
getToDoCount(); getToDoCount();
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
if (appointmentRateViewModel.isHaveAppointmentNotRate) { if (appointmentRateViewModel.isHaveAppointmentNotRate) {

@ -27,7 +27,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AskDoctorViewModel>( return BaseView<AskDoctorViewModel>(
onModelReady: (model) => model.getQuestionTypes(), // onModelReady: (model) => model.getQuestionTypes(),
onModelReady: (model) => model.getCallRequestTypeLOVs(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).requestType, appBarTitle: TranslationBase.of(context).requestType,

@ -34,11 +34,12 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLaboratoryResult( onModelReady: (model) => model.getLaboratoryResult(
invoiceNo: widget.patientLabOrders!.invoiceNo!, invoiceNo: widget.patientLabOrders!.invoiceNo,
clinicID: widget.patientLabOrders!.clinicID!, invoiceType: widget.patientLabOrders!.invoiceType,
projectID: widget.patientLabOrders!.projectID!, clinicID: widget.patientLabOrders!.clinicID,
orderNo: widget.patientLabOrders!.orderNo!, projectID: widget.patientLabOrders!.projectID,
setupID: widget.patientLabOrders!.setupID ?? "0", orderNo: widget.patientLabOrders!.orderNo,
setupID: widget.patientLabOrders!.setupID,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)), isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)),
), ),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(

@ -29,6 +29,7 @@ class RadiologyDetailsPage extends StatelessWidget {
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL( onModelReady: (model) => model.getRadImageURL(
projectId: finalRadiology!.projectID!, projectId: finalRadiology!.projectID!,
invoiceType: finalRadiology!.invoiceType,
lineItem: finalRadiology!.invoiceLineItemNo!, lineItem: finalRadiology!.invoiceLineItemNo!,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP : finalRadiology!.invoiceNo, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP : finalRadiology!.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!)), isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!)),

@ -292,7 +292,7 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
auth.AuthProvider().selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { auth.AuthProvider().selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
sharedPref.setObject(IMEI_USER_DATA, value); sharedPref.setObject(IMEI_USER_DATA, value);

@ -324,7 +324,7 @@ class _FooterWidgetState extends State<FooterWidget> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService authService
.selectDeviceImei(DEVICE_TOKEN) .selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) { .then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);

@ -191,11 +191,17 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).later, TranslationBase.of(context).later,
() { () {
Navigator.pushReplacement( // Navigator.pushReplacement(
// context,
// FadePage(
// page: LandingPage(),
// ),
// );
Navigator.pop(
context,
);
Navigator.pop(
context, context,
FadePage(
page: LandingPage(),
),
); );
}, },
color: CustomColors.accentColor, color: CustomColors.accentColor,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -15,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class RateAppointmentDoctor extends StatefulWidget { class RateAppointmentDoctor extends StatefulWidget {
@ -30,9 +32,11 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
String note = ""; String note = "";
int rating = 0; int rating = 0;
ProjectViewModel? projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AppointmentRateViewModel>( return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -189,12 +193,21 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
}); });
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} else { } else {
Navigator.pushReplacement( if(projectViewModel!.isLoginChild) {
context, Navigator.pushReplacement(
FadePage( context,
page: LandingPage(), FadePage(
), page: LandingPage(),
); ),
);
} else {
Navigator.pop(
context,
// FadePage(
// page: LandingPage(),
// ),
);
}
} }
}, },
color: CustomColors.accentColor, color: CustomColors.accentColor,

@ -46,10 +46,9 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
// Request req = appGlobal.getPublicRequest(); // Request req = appGlobal.getPublicRequest();
request = { request = {
// "LanguageID": languageID == 'ar' ? 1 : 2, //
// "IPAdress": "10.20.10.20", // "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID, // "VersionID": req.VersionID,
// "Channel": req.Channel, // "Channel": req.Channel,
@ -104,10 +103,8 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -143,10 +140,9 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, context) async { Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -176,10 +172,9 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsRating(int docID, context) async { Future<Map> getDoctorsRating(int docID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -227,10 +222,9 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsRatingDetails(int docID, context) async { Future<Map> getDoctorsRatingDetails(int docID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -258,7 +252,7 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel? projectViewModel]) async { Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"DoctorID": docID, "DoctorID": docID,
@ -270,7 +264,6 @@ class DoctorsListService extends BaseService {
"isReschadual": false, "isReschadual": false,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": 3, "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
@ -301,7 +294,7 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { Future<Map> getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"DoctorID": docID, "DoctorID": docID,
@ -314,7 +307,6 @@ class DoctorsListService extends BaseService {
"isReschadual": false, "isReschadual": false,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": 3, "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -342,7 +334,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsForLiveCare": false, "IsForLiveCare": false,
@ -366,7 +357,6 @@ class DoctorsListService extends BaseService {
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -410,7 +400,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsForLiveCare": true, "IsForLiveCare": true,
@ -433,7 +422,6 @@ class DoctorsListService extends BaseService {
"GenderID": authUser.gender, "GenderID": authUser.gender,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -463,7 +451,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -473,7 +460,6 @@ class DoctorsListService extends BaseService {
"IsActiveAppointment": true, "IsActiveAppointment": true,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -522,7 +508,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -533,7 +518,6 @@ class DoctorsListService extends BaseService {
"IsForLiveCare": true, "IsForLiveCare": true,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -563,17 +547,9 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {"ProjectID": 15, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType};
"LanguageID": languageID == 'ar' ? 1 : 2,
"ProjectID": 15,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes; dynamic localRes;
@ -593,11 +569,9 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"ProjectID": projectID, "ProjectID": projectID,
"SetupID": setupID, "SetupID": setupID,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
@ -617,9 +591,9 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientAppointmentHistoryWithAppoNo(int appoNo) async { Future<Map> getPatientAppointmentHistoryWithAppoNo(int appoNo, int languageID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false}; request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false, "LanguageID": languageID};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -638,14 +612,12 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsActiveAppointment": isActiveAppointment, "IsActiveAppointment": isActiveAppointment,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
@ -669,14 +641,13 @@ class DoctorsListService extends BaseService {
Future<Map> getPatientAppointmentCurfewHistory(bool isActiveAppointment) async { Future<Map> getPatientAppointmentCurfewHistory(bool isActiveAppointment) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsActiveAppointment": isActiveAppointment, "IsActiveAppointment": isActiveAppointment,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
@ -705,7 +676,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -716,7 +686,6 @@ class DoctorsListService extends BaseService {
"ConfirmationBy": 102, "ConfirmationBy": 102,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
@ -752,7 +721,6 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -770,7 +738,6 @@ class DoctorsListService extends BaseService {
"DeviceType": req.DeviceType, "DeviceType": req.DeviceType,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -801,7 +768,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -818,7 +784,6 @@ class DoctorsListService extends BaseService {
"StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate!), "StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate!),
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -848,7 +813,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -858,7 +822,6 @@ class DoctorsListService extends BaseService {
"IsFollowup": patientShareResponse.isFollowup, "IsFollowup": patientShareResponse.isFollowup,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -888,7 +851,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -901,7 +863,6 @@ class DoctorsListService extends BaseService {
"To": to, "To": to,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -929,14 +890,13 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"ClientRequestID": transactionID, "ClientRequestID": transactionID,
"IsPharmacy": isPharma, "IsPharmacy": isPharma,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -974,7 +934,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AdvanceNumber": advanceNumber, "AdvanceNumber": advanceNumber,
@ -983,7 +943,6 @@ class DoctorsListService extends BaseService {
"AppointmentID": appointmentID, "AppointmentID": appointmentID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1009,7 +968,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AdvanceNumber": advanceNumber, "AdvanceNumber": advanceNumber,
@ -1024,7 +983,6 @@ class DoctorsListService extends BaseService {
"DeviceType": Platform.isIOS ? "iOS" : "Android", "DeviceType": Platform.isIOS ? "iOS" : "Android",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1086,13 +1044,13 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> isAllowedToAskDoctor(int docID, BuildContext context) async { Future<Map> isAllowedToAskDoctor(int docID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsForAskYourDoctor": true, "IsForAskYourDoctor": true,
@ -1100,9 +1058,9 @@ class DoctorsListService extends BaseService {
"Top": 25, "Top": 25,
"beforeDays": 15, "beforeDays": 15,
"exludType": 4, "exludType": 4,
"LanguageID": languageID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1123,18 +1081,17 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getCallRequestType(BuildContext context) async { Future<Map> getCallRequestType(int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1143,6 +1100,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1155,19 +1113,20 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, BuildContext context) async { Future<Map> sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"ProjectID": appo.projectID, "ProjectID": appo.projectID,
"SetupID": appo.setupID, "SetupID": appo.setupID,
"DoctorID": appo.doctorID, "DoctorID": appo.doctorID,
"ClinicID": appo.clinicID,
"RequestType": requestType, "RequestType": requestType,
"RequestTypeID": requestType, "RequestTypeID": requestType,
"PatientMobileNumber": authUser.mobileNumber, "PatientMobileNumber": authUser.mobileNumber,
@ -1182,7 +1141,6 @@ class DoctorsListService extends BaseService {
"EditedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0], "EditedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0],
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1191,6 +1149,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1209,13 +1168,12 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appoNo, "AppointmentNo": appoNo,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1242,7 +1200,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appoNo, "AppointmentNo": appoNo,
@ -1250,7 +1208,6 @@ class DoctorsListService extends BaseService {
"ClinicID": clinicID, "ClinicID": clinicID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1277,7 +1234,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appo.appointmentNo, "AppointmentNo": appo.appointmentNo,
@ -1287,7 +1244,6 @@ class DoctorsListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"SetupID": appo.setupID, "SetupID": appo.setupID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1314,7 +1270,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentDate": appoDate, "AppointmentDate": appoDate,
@ -1327,7 +1283,6 @@ class DoctorsListService extends BaseService {
"SetupID": setupId, "SetupID": setupId,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1354,7 +1309,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"ProjectID": projectID, "ProjectID": projectID,
@ -1372,7 +1327,6 @@ class DoctorsListService extends BaseService {
}, },
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1399,7 +1353,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -1418,7 +1372,7 @@ class DoctorsListService extends BaseService {
"PaymentMethod": paymentMethodName, "PaymentMethod": paymentMethodName,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1444,13 +1398,12 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1485,13 +1438,12 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1529,14 +1481,13 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"MedCategoryID": medCategoryId, "MedCategoryID": medCategoryId,
"MedGetStsID": medCategoryStsId, "MedGetStsID": medCategoryStsId,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1556,14 +1507,10 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async { Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy};
"AppointmentNo": appointmentNo,
"NFC_Code": nfcCode,
"ProjectID": projectId,
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -1829,7 +1776,6 @@ class DoctorsListService extends BaseService {
Map<String, dynamic> requestFreeSlots; Map<String, dynamic> requestFreeSlots;
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
requestFreeSlots = { requestFreeSlots = {
"DoctorID": docID, "DoctorID": docID,
@ -1841,7 +1787,6 @@ class DoctorsListService extends BaseService {
"isReschadual": false, "isReschadual": false,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": 3, "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,

@ -151,24 +151,31 @@ class AuthProvider with ChangeNotifier {
} }
} }
Future<SelectDeviceIMEIRES> selectDeviceImei(imei) async { Future<SelectDeviceIMEIRES?> selectDeviceImei(imei) async {
try { try {
dynamic localRes; dynamic localRes;
print(imei); print(imei);
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['IMEI'] = imei; request['IMEI'] = imei;
await BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { await BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) async {
localRes = Map(); localRes = Map();
if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) { if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) {
localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); localRes = SelectDeviceIMEIRES.fromJson(
response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
} }
request['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { });
}
catch (error) {
return Future.error(error); return Future.error(error);
} }
} }
Future<dynamic> checkPatientAuthentication(CheckPatientAuthenticationReq request) async { Future<dynamic> checkPatientAuthentication(CheckPatientAuthenticationReq request) async {

@ -38,6 +38,7 @@ class ClinicListService extends BaseService {
request = { request = {
"IsActiveAppointment": true, "IsActiveAppointment": true,
"LanguageID": 1
}; };
dynamic localRes; dynamic localRes;
@ -143,6 +144,10 @@ class ClinicListService extends BaseService {
Future<Map> getProjectsList(context) async { Future<Map> getProjectsList(context) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request = {
"LanguageID": null
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async {

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
@ -9,6 +11,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsBySta
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
// SharedPreferences sharedPref = new SharedPreferences(); // SharedPreferences sharedPref = new SharedPreferences();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
@ -36,7 +39,7 @@ class FamilyFilesProvider with ChangeNotifier {
dynamic authenticatedUser; dynamic authenticatedUser;
GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse();
Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async { Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus(int languageID) async {
dynamic localRes; dynamic localRes;
try { try {
var request = GetAllSharedRecordsByStatusReq(); var request = GetAllSharedRecordsByStatusReq();
@ -234,7 +237,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser, {onSuccess, mainUser}) async { Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser, int languageID, {onSuccess, mainUser}) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
if (mainUser == true) { if (mainUser == true) {
var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER) ?? ""); var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER) ?? "");
@ -252,6 +255,7 @@ class FamilyFilesProvider with ChangeNotifier {
request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966";
request['activationCode'] = '0000'; request['activationCode'] = '0000';
request['isRegister'] = false; request['isRegister'] = false;
request['LanguageID'] = languageID;
} else { } else {
var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
//const request = new SwitchUserRequest(); //const request = new SwitchUserRequest();
@ -277,6 +281,7 @@ class FamilyFilesProvider with ChangeNotifier {
// request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; // request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966";
request['activationCode'] = '0000'; request['activationCode'] = '0000';
request['isRegister'] = false; request['isRegister'] = false;
request['LanguageID'] = languageID;
} }
try { try {
dynamic localRes; dynamic localRes;
@ -289,7 +294,8 @@ class FamilyFilesProvider with ChangeNotifier {
}, body: request); }, body: request);
sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType'] ?? ""); sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType'] ?? "");
return Future.value(localRes); return Future.value(localRes);
} catch (error) { }
catch (error) {
print(error); print(error);
throw error; throw error;
} }

@ -57,7 +57,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getLiveCareScheduledDoctorList(BuildContext context, int serviceID) async { Future<Map> getLiveCareScheduledDoctorList(BuildContext context, int serviceID, int languageID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -69,7 +69,8 @@ class LiveCareService extends BaseService {
"ServiceID": serviceID, "ServiceID": serviceID,
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0,
"LanguageID": languageID
}; };
dynamic localRes; dynamic localRes;
@ -146,7 +147,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getERAppointmentFees(int serviceID, bool isPharmaLiveCare, BuildContext context) async { Future<Map> getERAppointmentFees(int serviceID, bool isPharmaLiveCare, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -160,7 +161,8 @@ class LiveCareService extends BaseService {
"ProjectID": 12, "ProjectID": 12,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0,
"LanguageID": languageID
}; };
dynamic localRes; dynamic localRes;
@ -173,7 +175,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getERAppointmentTime(int serviceID, bool isPharmaLiveCare, BuildContext context) async { Future<Map> getERAppointmentTime(int serviceID, bool isPharmaLiveCare, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -187,7 +189,8 @@ class LiveCareService extends BaseService {
"ProjectID": 12, "ProjectID": 12,
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0,
"LanguageID": languageID
}; };
dynamic localRes; dynamic localRes;

@ -15,11 +15,9 @@ class MyInvoicesService extends BaseService {
Future<Map> getAllDentalAppointments(int projectID, context) async { Future<Map> getAllDentalAppointments(int projectID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -38,8 +36,7 @@ class MyInvoicesService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -49,11 +46,9 @@ class MyInvoicesService extends BaseService {
Future<Map> getDentalAppointmentInvoice(int projectID, int appoNo, int invoiceNo, context) async { Future<Map> getDentalAppointmentInvoice(int projectID, int appoNo, int invoiceNo, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -74,22 +69,19 @@ class MyInvoicesService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DENTAL_APPOINTMENT_INVOICE, await baseAppClient.post(GET_DENTAL_APPOINTMENT_INVOICE, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendDentalAppointmentInvoiceEmail(int projectID, int appoNo, context) async { Future<Map> sendDentalAppointmentInvoiceEmail(int projectID, int appoNo, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -110,13 +102,11 @@ class MyInvoicesService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL, await baseAppClient.post(SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -23,11 +23,9 @@ class SmartWatchIntegrationService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,

@ -63,7 +63,11 @@ class _SplashScreenState extends State<SplashScreen> {
AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en");
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false); var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));
PushNotificationHandler.getInstance().init(context); // Asyncronously PushNotificationHandler().init(context); // Asyncronously
AppSharedPreferences().getAll().then((value) {
// debugPrint("ALL SHARED PREFERENCES!!!!!");
// debugPrint(jsonEncode(value));
});
} }
@override @override

@ -128,8 +128,8 @@ class LocationUtils {
heading: 0.0, heading: 0.0,
speed: 0.0, speed: 0.0,
speedAccuracy: 1, speedAccuracy: 1,
altitudeAccuracy: 0.0, // altitudeAccuracy: 0.0,
headingAccuracy: 0.0, // headingAccuracy: 0.0,
// altitudeAccuracy: 0, // altitudeAccuracy: 0,
// headingAccuracy: 0, // headingAccuracy: 0,
// Added by Aamir // Added by Aamir

@ -295,7 +295,7 @@ class _TimeLineViewState extends State<TimeLineView> {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
sharedPref.setObject(IMEI_USER_DATA, value); sharedPref.setObject(IMEI_USER_DATA, value);

@ -1,5 +1,3 @@
import 'dart:convert';
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
@ -218,7 +216,7 @@ class _AppDrawerState extends State<AppDrawer> {
: SizedBox(), : SizedBox(),
FutureBuilder( FutureBuilder(
future: getFamilyFiles(), // async work future: getFamilyFiles(), // async work
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse?> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.all(10), child: Text('')); return Padding(padding: EdgeInsets.all(10), child: Text(''));
@ -631,7 +629,7 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);
@ -652,23 +650,23 @@ class _AppDrawerState extends State<AppDrawer> {
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('login'); locator<GAnalytics>().hamburgerMenu.logMenuItemClick('login');
} }
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async { Future<GetAllSharedRecordsByStatusResponse?> getFamilyFiles() async {
if (user != null) { if (user != null) {
if (await sharedPref.getObject(FAMILY_FILE) != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE)); // print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE))); return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE)));
} else { } else {
return familyFileProvider.getSharedRecordByStatus(); int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
return familyFileProvider.getSharedRecordByStatus(languageID);
} }
} }
return familyFileProvider.getSharedRecordByStatus();
} }
switchUser(user, context) { switchUser(user, context) {
GetAllSharedRecordsByStatusList switchUser = GetAllSharedRecordsByStatusList.fromJson(jsonDecode(jsonEncode(user))); int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
sharedPref.remove(BLOOD_TYPE); sharedPref.remove(BLOOD_TYPE);
this.familyFileProvider.silentLoggin(switchUser, mainUser: user is AuthenticatedUser).then((value) { this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
// Navigator.of(context).pop(); // Navigator.of(context).pop();
loginAfter(value, context, user is AuthenticatedUser); loginAfter(value, context, user is AuthenticatedUser);
@ -676,7 +674,7 @@ class _AppDrawerState extends State<AppDrawer> {
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err.toString());
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
} }
@ -720,8 +718,10 @@ class _AppDrawerState extends State<AppDrawer> {
if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList(languageID)
.then((value) => { .then((value) => {
getToDoCount(), getToDoCount(),
//Utils.hideProgressDialog(), //Utils.hideProgressDialog(),

@ -27,7 +27,12 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
ios: IOSInAppWebViewOptions(applePayAPIEnabled: true, isFraudulentWebsiteWarningEnabled: false)), ios: IOSInAppWebViewOptions(applePayAPIEnabled: true, isFraudulentWebsiteWarningEnabled: false)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black), crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black),
android: AndroidInAppBrowserOptions(), android: AndroidInAppBrowserOptions(),
ios: IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); ios: IOSInAppBrowserOptions(
hideToolbarBottom: true,
toolbarBottomBackgroundColor: Colors.white,
closeButtonColor: Colors.white,
closeButtonCaption: "Close",
presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN));
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE? paymentType; _PAYMENT_TYPE? paymentType;
@ -281,7 +286,7 @@ class MyInAppBrowser extends InAppBrowser {
Platform.isIOS Platform.isIOS
? form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN)) ? form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN))
: form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); : form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN) ?? "");
// form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN)); // form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN));
// form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); // form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));

@ -335,7 +335,7 @@ class _NotAutPageState extends State<NotAutPage> {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
sharedPref.setObject(IMEI_USER_DATA, value); sharedPref.setObject(IMEI_USER_DATA, value);

@ -125,7 +125,7 @@ class BottomNavPharmacyItem extends StatelessWidget {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);

Loading…
Cancel
Save