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/config/localized_values.dart
#	lib/core/service/client/base_app_client.dart
#	lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart
#	lib/pages/Blood/blood_donation.dart
#	lib/pages/BookAppointment/BookSuccess.dart
#	lib/pages/MyAppointments/AppointmentDetails.dart
#	lib/pages/MyAppointments/widgets/AppointmentActions.dart
#	lib/pages/ToDoList/ToDo.dart
#	lib/pages/livecare/widgets/clinic_list.dart
#	lib/pages/medical/balance/confirm_payment_page.dart
dev_v3.13.6_BLE_Faiz
Sultan khan 7 months ago
commit c9be715436

@ -65,7 +65,7 @@ class GAnalytics {
if (await PermissionService.isLocationEnabled()) {
final location = await Geolocator.getCurrentPosition();
if (location != null && !location.isMocked) {
final places = await placemarkFromCoordinates(location.latitude, location.longitude, localeIdentifier: 'en_US');
final places = await placemarkFromCoordinates(location.latitude, location.longitude,);
final countryCode = places.first.isoCountryCode;
_analytics.setUserProperty(name: 'user_country', value: countryCode);
}

@ -660,13 +660,17 @@ var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder';
var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity';
var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany';
var GET_BLOOD_DONATION_PROJECTS_LIST = 'Services/OUTPs.svc/REST/BD_getProjectsHaveBDClinics';
var GET_BLOOD_DONATION_FREE_SLOTS = 'Services/OUTPs.svc/REST/BD_GetFreeSlots';
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
var payFortEnvironment = FortEnvironment.production;
var applePayMerchantId = "merchant.com.hmgwebservices";
// var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat";
// var payFortEnvironment = FortEnvironment.production;
// var applePayMerchantId = "merchant.com.hmgwebservices";
var payFortEnvironment = FortEnvironment.test;
var applePayMerchantId = "merchant.com.hmgwebservices.uat";
class AppGlobal {
static var context;

@ -182,7 +182,10 @@ const Map localizedValues = {
'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'},
'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'},
'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'},
'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول'},
'scanQRHospital': {
'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In',
'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول'
},
'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'},
"sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"},
"success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"},
@ -1845,39 +1848,51 @@ const Map localizedValues = {
"privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"},
"termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"},
"prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."},
"liveCarePermissions": {"en": "LiveCare requires Camera, Microphone & Location permissions to enable virtual consultation between patient & doctor, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة."},
"lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" },
"lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" },
"lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" },
"deleteAccount": { "en": "Deactivate Account", "ar": "ايقاف الحساب مؤقتاً" },
"deactivateAccount": { "en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد ايقاف الحساب مؤقتاً حسابك؟" },
"accountDeactivated": { "en": "Your account has been deactivated successfully", "ar": "تم ايقاف الحساب مؤقتاً بنجاح." },
"accountDeactivatedMsg": { "en": "Your account has been deactivated. Would you like to reactivate it?", "ar": "حسابك معطل. هل ترغب في إعادة تنشيطه مرة أخرى؟" },
"updateInsuranceManually": { "en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا" },
"or": { "en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا" },
"enterInsuranceDetails": { "en": "Please enter your insurance card details below:", "ar": "الرجاء إدخال تفاصيل بطاقة التأمين الخاصة بك أدناه:" },
"cardHolderName": { "en": "Card Holder Name", "ar": "إسم صاحب البطاقة" },
"membershipNo": { "en": "Membership No.", "ar": "رقم العضوية" },
"policyNo": { "en": "Policy No.", "ar": "رقم وثيقة التأمين" },
"paymentOnly": { "en": "Payment", "ar": "معلقة" },
"pendingOnly": { "en": "Pending", "ar": "مدفوعات" },
"insuranceClassName": { "en": "Insurance Class", "ar": "فئة التأمين" },
"insuranceRequestSubmit": { "en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح." },
"NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" },
"liveCarePermissions": {
"en": "LiveCare requires Camera, Microphone & Location permissions to enable virtual consultation between patient & doctor, Please allow these to proceed.",
"ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة."
},
"lakumUnhold": {"en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل"},
"lakumDiscontinue": {"en": "The account is closed", "ar": "الحساب مغلق"},
"lakumSuccess": {"en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح"},
"deleteAccount": {"en": "Deactivate Account", "ar": "ايقاف الحساب مؤقتاً"},
"deactivateAccount": {"en": "Are you sure you want to deactivate your account?", "ar": "هل أنت متأكد أنك تريد ايقاف الحساب مؤقتاً حسابك؟"},
"accountDeactivated": {"en": "Your account has been deactivated successfully", "ar": "تم ايقاف الحساب مؤقتاً بنجاح."},
"accountDeactivatedMsg": {"en": "Your account has been deactivated. Would you like to reactivate it?", "ar": "حسابك معطل. هل ترغب في إعادة تنشيطه مرة أخرى؟"},
"updateInsuranceManually": {"en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا"},
"or": {"en": "Update Insurance Manually", "ar": "تحديث التأمين يدويا"},
"enterInsuranceDetails": {"en": "Please enter your insurance card details below:", "ar": "الرجاء إدخال تفاصيل بطاقة التأمين الخاصة بك أدناه:"},
"cardHolderName": {"en": "Card Holder Name", "ar": "إسم صاحب البطاقة"},
"membershipNo": {"en": "Membership No.", "ar": "رقم العضوية"},
"policyNo": {"en": "Policy No.", "ar": "رقم وثيقة التأمين"},
"paymentOnly": {"en": "Payment", "ar": "معلقة"},
"pendingOnly": {"en": "Pending", "ar": "مدفوعات"},
"insuranceClassName": {"en": "Insurance Class", "ar": "فئة التأمين"},
"insuranceRequestSubmit": {"en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح."},
"NFCNotSupported": {"en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول"},
"enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"},
"workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"},
"callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"},
"needApproval": {"en": "Your sick leave is under process in medical administration, you will be notified once approved.", "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."},
"needApproval": {
"en": "Your sick leave is under process in medical administration, you will be notified once approved.",
"ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."
},
"pendingActivation": {"en": "Pending Activation", "ar": "في انتظار التنشيط"},
"awaitingApproval": {"en": "Awaiting Approval", "ar": "انتظر القبول"},
"liveCareSupportContact": {"en": "LiveCare Support Contact: ", "ar": "اتصل لايف كير: "},
"pharmaLiveCare": {"en": "Pharma LiveCare", "ar": "لايف كير الصيدلية"},
"pharmaLiveCare1": {"en": "What is Pharma LiveCare?", "ar": "ما هولايف كير الصيدلية؟"},
"pharmaLiveCareDesc1": {"en": "Pharma LiveCare allows you to get consultation from your doctor virtually being in HMG Pharmacy booth.", "ar": "تتيح لك خدمة لايف كير الصيدلية الحصول على استشارة من طبيبك المتواجد فعليًا في كشك صيدلية د.سليمان الحبيب."},
"pharmaLiveCareDesc1": {
"en": "Pharma LiveCare allows you to get consultation from your doctor virtually being in HMG Pharmacy booth.",
"ar": "تتيح لك خدمة لايف كير الصيدلية الحصول على استشارة من طبيبك المتواجد فعليًا في كشك صيدلية د.سليمان الحبيب."
},
"wherePharmaLiveCare": {"en": "Where can i find Pharma LiveCare?", "ar": "أين يمكنني أن أجد لايف كير الصيدلية؟"},
"pharmaLiveCareDesc2": {"en": "You can find the booth in HMG Pharmacies.", "ar": "يمكنك العثور على الكشك في صيدليات مستشفى د.سليمان الحبيب."},
"howPharmaLiveCare": {"en": "How can i use Pharma LiveCare?", "ar": "كيف يمكنني استخدام لايف كير الصيدلية؟"},
"pharmaLiveCareDesc3": {"en": "Following the below steps you can easily benefit from the virtual consultation service:", "ar": "باتباع الخطوات التالية يمكنك الاستفادة بسهولة من خدمة الاستشارة الافتراضية:"},
"pharmaLiveCareDesc3": {
"en": "Following the below steps you can easily benefit from the virtual consultation service:",
"ar": "باتباع الخطوات التالية يمكنك الاستفادة بسهولة من خدمة الاستشارة الافتراضية:"
},
"pharmaLiveCareScanQR": {"en": "Scan QR Code", "ar": "مسح رمز الاستجابة السريعة"},
"pharmaLiveCareScanQR1": {"en": "Scan the QR Code in the booth to make the connection", "ar": "امسح رمز الاستجابة السريعة في المقصورة لإجراء الاتصال"},
"pharmaLiveCareMakePayment": {"en": "Make Payment Online", "ar": "قم بالدفع عبر الإنترنت"},
@ -1934,24 +1949,29 @@ const Map localizedValues = {
"admissionReqNo": {"en": "Admission Request No", "ar": "رقم طلب القبول:"},
"dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"},
"selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"},
"invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."},
"invalidEligibility": {
"en": "You cannot make online payment because you are not eligible to use the provided service.",
"ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."
},
"invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."},
"continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"},
"updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"},
"downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"},
"habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."},
"cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"},
"cashAmountUpdateInsurance": {
"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:",
"ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"
},
"validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"},
"contactRRT": {"en": "Contact RRT", "ar": "تواصل مع فريق الاستجابة السريعة"},
"checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"},
"locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."},
"onlyAdmitted": {"en": "This service is only available for admitted patients", "ar": "هذه الخدمة متاحة فقط للمرضى المقبولين"},
"assistYou": {"en": "How we may assist you?", "ar": "كيف يمكننا مساعدتك؟"},
"receive": {"en": "Receive", "ar": "تجهيز"},
"PRO": {"en": "PRO", "ar": "علاقات المرضى"},
"patientRelationOffice": {"en": "Patient Relation Office", "ar": "علاقات المرضى"},
"locationCheckInError": {
"en": "Please make sure that you're within the hospital location to perform online check-in.",
"ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."
},
"upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"},
"noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"},
"locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "ar": "غير قادر على جلب موقعك، يرجى المحاولة مرة أخرى."},
"loadMore": {"en": "Load More", "ar": "تحميل المزيد"},
};
"selectHospitalBloodDonation": {"en": "Please select the hospital you want to book an appointment with: ", "ar": "يرجى اختيار المستشفى الذي تريد حجز موعد معه:"},
};

@ -0,0 +1,25 @@
class BloodDonationFreeSlotsResponseModel {
int? clinicID;
int? doctorID;
String? freeTimeSlots;
int? projectID;
BloodDonationFreeSlotsResponseModel(
{this.clinicID, this.doctorID, this.freeTimeSlots, this.projectID});
BloodDonationFreeSlotsResponseModel.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
freeTimeSlots = json['FreeTimeSlots'];
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['FreeTimeSlots'] = this.freeTimeSlots;
data['ProjectID'] = this.projectID;
return data;
}
}

@ -0,0 +1,46 @@
class BloodDonationProjectsListResponse {
int? rowID;
int? iD;
int? projectID;
int? numberOfRooms;
bool? isActive;
int? createdBy;
String? createdOn;
dynamic editedBy;
dynamic editedON;
String? projectName;
dynamic projectNameN;
BloodDonationProjectsListResponse(
{this.rowID, this.iD, this.projectID, this.numberOfRooms, this.isActive, this.createdBy, this.createdOn, this.editedBy, this.editedON, this.projectName, this.projectNameN});
BloodDonationProjectsListResponse.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
iD = json['ID'];
projectID = json['ProjectID'];
numberOfRooms = json['NumberOfRooms'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedON = json['EditedON'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['ID'] = this.iD;
data['ProjectID'] = this.projectID;
data['NumberOfRooms'] = this.numberOfRooms;
data['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedON'] = this.editedON;
data['ProjectName'] = this.projectName;
data['ProjectNameN'] = this.projectNameN;
return data;
}
}

@ -70,4 +70,31 @@ class BloodDonationService extends BaseService {
throw error;
}
}
Future<Map> getBloodDonationProjectsList() async {
Map<String, dynamic> request;
request = {};
dynamic localRes;
await baseAppClient.post(GET_BLOOD_DONATION_PROJECTS_LIST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getBloodDonationFreeSlots(int clinicID, int projectID) async {
Map<String, dynamic> request;
request = {"ClinicID": clinicID, "ProjectID": projectID};
dynamic localRes;
await baseAppClient.post(GET_BLOOD_DONATION_FREE_SLOTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -39,12 +39,12 @@ class BaseAppClient {
post(String endPoint,
{required Map<String, dynamic> body,
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false,
bool bypassConnectionCheck = false}) async {
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false,
bool bypassConnectionCheck = false}) async {
String url;
if (isExternal) {
url = endPoint;
@ -72,28 +72,28 @@ class BaseAppClient {
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
// if (body.containsKey('LanguageID')) {
if (body['LanguageID'] != null) {
//change this line because language issue happened on dental
body['LanguageID'] = body['LanguageID'] == 'ar'
? 1
: body['LanguageID'] == 'en'
? 2
: body['LanguageID'];
if (body.containsKey('LanguageID')) {
if (body['LanguageID'] != null) {
//change this line because language issue happened on dental
body['LanguageID'] = body['LanguageID'] == 'ar'
? 1
: body['LanguageID'] == 'en'
? 2
: body['LanguageID'];
} else {
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
} else {
body['LanguageID'] =
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false)
.isArabic
? 1
: 2;
// body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2);
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
// } else {
// // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2);
@ -117,19 +117,18 @@ class BaseAppClient {
body['Longitude'] = long;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isIOS
? 1
: await Utils.isGoogleServicesAvailable()
? 2
: 3;
? 2
: 3;
if (!body.containsKey('IsPublicRequest')) {
// if (!body.containsKey('PatientType')) {
@ -172,8 +171,8 @@ class BaseAppClient {
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: user['OutSA']
? body['PatientOutSA']
: user['OutSA']
: user['OutSA'];
body['SessionID'] = getSessionId(
body['TokenID'] != null ? body['TokenID'] : ""); //getSe
@ -561,18 +560,17 @@ class BaseAppClient {
Future navigateToAppUpdate(context, String text) async {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => AppUpdatePage(appUpdateText: text)),
(Route<dynamic> route) => false,
MaterialPageRoute(builder: (context) => AppUpdatePage(appUpdateText: text)),
(Route<dynamic> route) => false,
);
}
get(String endPoint,
{Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
Map<String, dynamic>? queryParams,
bool isExternal = false,
bool isRCService = false}) async {
{required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
Map<String, dynamic>? queryParams,
bool isExternal = false,
bool isRCService = false}) async {
String url;
if (isExternal) {
url = endPoint;
@ -616,11 +614,11 @@ class BaseAppClient {
}
getPharmacy(String endPoint,
{Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
bool isAllowAny = false,
bool isExternal = false,
Map<String, dynamic>? queryParams}) async {
{required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
Map<String, dynamic>? queryParams}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
@ -682,12 +680,12 @@ class BaseAppClient {
}
simplePost(
String fullUrl, {
Map<dynamic, dynamic>? body,
Map<String, String>? headers,
Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
}) async {
String fullUrl, {
required Map<dynamic, dynamic> body,
required Map<String, String> headers,
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure,
}) async {
String url = fullUrl;
// print("URL Query String: $url");
// print("body: $body");
@ -928,8 +926,8 @@ class BaseAppClient {
if (body!.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
@ -941,17 +939,16 @@ class BaseAppClient {
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: user['OutSA']
? body['PatientOutSA']
: user['OutSA']
: user['OutSA'];
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -959,18 +956,18 @@ class BaseAppClient {
if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: user['PatientType']
? body['PatientType']
: user['PatientType'] != null
? user['PatientType']
: user['PatientType']
: user['PatientType'];
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: user['PatientType']
? body['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: user['PatientType']
: user['PatientType'];
if (user != null) {
body['TokenID'] = token;

@ -658,27 +658,32 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Ancillary Order Payment",
orderAmount: double.parse(getTotalValue()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.projectID,
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
);
if (res["MessageStatus"] == 1) {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Ancillary Order Payment",
orderAmount: double.parse(getTotalValue()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.projectID,
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);

@ -1,3 +1,382 @@
// import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
// import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
// import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
// import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
// import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
// import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
// import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
// import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
// import 'package:diplomaticquarterapp/pages/base/base_view.dart';
// import 'package:diplomaticquarterapp/theme/colors.dart';
// import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
// import 'package:diplomaticquarterapp/uitl/app_toast.dart';
// import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
// import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
// import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
// import 'package:diplomaticquarterapp/widgets/show_zoom_image_dialog.dart';
// import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
// import 'package:flutter/cupertino.dart';
// import 'package:flutter/material.dart';
// import 'package:provider/provider.dart';
//
// enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
// enum Gender { Male, Female, NON }
// enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON }
//
// class BloodDonationPage extends StatefulWidget {
// @override
// _BloodDonationPageState createState() => _BloodDonationPageState();
// }
//
// class _BloodDonationPageState extends State<BloodDonationPage> {
// BeneficiaryType beneficiaryType = BeneficiaryType.NON;
//
// CitiesModel _selectedHospital;
//
// int _selectedHospitalIndex = 0;
// int _selectedGenderIndex = 1;
// int _selectedBloodTypeIndex = 0;
// String _selectedBloodType = "O+";
//
// String amount = "";
// String email;
//
// List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
// AppSharedPreferences sharedPref = AppSharedPreferences();
// var checkedValue = false;
// List<ImagesInfo> imagesInfo = List();
//
// ProjectViewModel projectProvider;
//
// @override
// void initState() {
// imagesInfo.add(
// ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'),
// );
// WidgetsBinding.instance.addPostFrameCallback((_) {});
// super.initState();
// }
//
// int getSelectedCityID(MyBalanceViewModel model) {
// int cityID = 1;
// model.CitiesModelList.forEach((element) {
// if (element.description == model.bloodModelList[0].city) {
// cityID = element.iD;
// }
// });
// return cityID;
// }
//
// @override
// Widget build(BuildContext context) {
// projectProvider = Provider.of(context);
//
// return BaseView<MyBalanceViewModel>(
// onModelReady: (model) => model.getCities().then((value) {
// model.getBlood().then((value) {
// if (model.bloodModelList.length > 0) {
// CitiesModel citiesModel = new CitiesModel();
// citiesModel.iD = getSelectedCityID(model);
// _selectedHospitalIndex = (citiesModel.iD - 1);
// citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
// citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
// _selectedHospital = citiesModel;
// _selectedBloodType = model.bloodModelList[0].bloodGroup;
// _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
// } else {
// _selectedHospital = model.CitiesModelList[0];
// }
// });
// }),
// // {
// // if (projectProvider.isLogin && projectProvider.user != null) {
// // model.getCities().then((value) {
// // model.getBlood().then((value) {
// // if (model.bloodModelList.length > 0) {
// // CitiesModel citiesModel = new CitiesModel();
// // citiesModel.iD = getSelectedCityID(model);
// // _selectedHospitalIndex = (citiesModel.iD - 1);
// // citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
// // citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
// // _selectedHospital = citiesModel;
// // _selectedBloodType = model.bloodModelList[0].bloodGroup;
// // _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
// // } else {
// // _selectedHospital = model.CitiesModelList[0];
// // }
// // });
// // });
// // }
// // },
// builder: (_, model, w) => AppScaffold(
// isShowAppBar: true,
// showNewAppBar: true,
// backgroundColor: Color(0xffF7F7F7),
// showNewAppBarTitle: true,
// baseViewModel: model,
// isShowDecPage: true,
// imagesInfo: imagesInfo,
// description: TranslationBase.of(context).bloodDonationInfo,
// appBarTitle: TranslationBase.of(context).bloodD,
// body: Column(
// children: [
// Expanded(
// child: SingleChildScrollView(
// physics: BouncingScrollPhysics(),
// padding: EdgeInsets.all(21),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// TranslationBase.of(context).bloodDEnterDesc,
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
// ),
// SizedBox(height: 12),
// if (projectProvider.isLogin && model.state != ViewState.Busy)
//
// CommonDropDownView(
// TranslationBase.of(context).city,
// model.CitiesModelList.isNotEmpty
// ? projectProvider.isArabic
// ? model.CitiesModelList[_selectedHospitalIndex].descriptionN
// : model.CitiesModelList[_selectedHospitalIndex].description
// : "", () {
// List<RadioSelectionDialogModel> list = [
// for (int i = 0; i < model.CitiesModelList.length; i++)
// RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i),
// ];
//
// showDialog(
// context: context,
// builder: (cxt) => RadioSelectionDialog(
// listData: list,
// selectedIndex: _selectedHospitalIndex,
// isScrollable: true,
// onValueSelected: (index) {
// _selectedHospitalIndex = index;
// _selectedHospital = model.CitiesModelList[index];
// setState(() {});
// },
// ),
// );
// }).withBorderedContainer,
// SizedBox(height: 12),
// CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () {
// List<RadioSelectionDialogModel> list = [
// RadioSelectionDialogModel(TranslationBase.of(context).male, 1),
// RadioSelectionDialogModel(TranslationBase.of(context).female, 2),
// ];
//
// showDialog(
// context: context,
// builder: (cxt) => RadioSelectionDialog(
// listData: list,
// selectedIndex: _selectedGenderIndex,
// onValueSelected: (index) {
// _selectedGenderIndex = index;
// setState(() {});
// },
// ),
// );
// }).withBorderedContainer,
// SizedBox(height: 12),
// CommonDropDownView(TranslationBase.of(context).bloodType, _selectedBloodType, () {
// List<RadioSelectionDialogModel> list = [
// RadioSelectionDialogModel("O+", 0),
// RadioSelectionDialogModel("O-", 1),
// RadioSelectionDialogModel("AB+", 2),
// RadioSelectionDialogModel("AB-", 3),
// RadioSelectionDialogModel("A+", 4),
// RadioSelectionDialogModel("A-", 5),
// RadioSelectionDialogModel("B+", 6),
// RadioSelectionDialogModel("B-", 7),
// ];
//
// showDialog(
// context: context,
// builder: (cxt) => RadioSelectionDialog(
// listData: list,
// selectedIndex: _selectedBloodTypeIndex,
// isScrollable: true,
// onValueSelected: (index) {
// _selectedBloodTypeIndex = index;
// _selectedBloodType = getBlood(index);
// setState(() {});
// },
// ),
// );
// }).withBorderedContainer,
// SizedBox(height: 12),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Text(
// TranslationBase.of(context).viewTermsConditions + ":",
// style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56),
// ),
// InkWell(
// onTap: () {
// Navigator.of(context).push(FadePage(page: UserAgreementPage()));
// },
// child: Text(
// TranslationBase.of(context).clickHere,
// style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56),
// ),
// )
// ],
// ),
// SizedBox(height: 12),
// Row(
// children: [
// Checkbox(
// onChanged: (bool value) {
// setState(() {
// checkedValue = value;
// });
// },
// value: checkedValue,
// activeColor: Color(0xFFc5272d),
// ),
// Text(
// TranslationBase.of(context).iAgreeToTheTermsAndConditions,
// style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
// ),
// ],
// ),
// SizedBox(
// height: 10,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Center(
// child: Container(
// color: Theme.of(context).primaryColor,
// width: 350,
// child: InkWell(
// onTap: () {
// showZoomImageDialog(context, 'assets/images/BloodChrt_EN.png', isNetworkImage: false);
// },
// child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png'), color: Colors.white),
// ),
// ),
// ),
// ],
// ),
// SizedBox(
// height: MediaQuery.of(context).size.height * 0.15,
// )
// ],
// ),
// ),
// ),
// DefaultButton(
// TranslationBase.of(context).save,
// checkedValue
// ? () async {
// if (_selectedHospital == null) {
// AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
// return;
// }
// bloodDetails.city = _selectedHospital.description;
// bloodDetails.cityCode = _selectedHospital.iD.toString();
// bloodDetails.gender = _selectedGenderIndex;
// bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
// await model.updateBloodGroup(bloodDetails);
// if (model.state == ViewState.Idle) {
// AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
// } else {
// AppToast.showErrorToast(message: model.error);
// }
// }
// : null,
// disabledColor: CustomColors.grey2,
// ).insideContainer
// ],
// ),
// ),
// );
// }
//
// String getBlood(int index) {
// switch (index) {
// case 0:
// return "O+";
// break;
// case 1:
// return "O-";
// break;
// case 2:
// return "AB+";
// break;
// case 3:
// return "AB-";
// break;
// case 4:
// return "A+";
// break;
// case 5:
// return "A-";
// break;
// case 6:
// return "B-";
// break;
// case 7:
// return "B-";
// break;
// case 8:
// return "B+";
// break;
//
// default:
// return "";
// }
// }
//
// int getBloodIndex(String type) {
// switch (type) {
// case "O+":
// return 0;
// break;
// case "O-":
// return 1;
// break;
// case "AB+":
// return 2;
// break;
// case "AB-":
// return 3;
// break;
// case "A+":
// return 4;
// break;
// case "A-":
// return 5;
// break;
// case "B-":
// return 6;
// break;
// case "B-":
// return 7;
// break;
// case "B+":
// return 8;
// break;
//
// default:
// return 0;
// }
// }
//
// String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
// if (_selectedHospital != null)
// return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
// else
// return TranslationBase.of(context).selectCity;
// }
// }
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
@ -5,12 +384,15 @@ import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dar
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation_book_appointment.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -138,14 +520,14 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
if (projectProvider.isLogin && model.state != ViewState.Busy)
CommonDropDownView(
TranslationBase.of(context).city,
model.CitiesModelList.isNotEmpty
? projectProvider.isArabic
? model.CitiesModelList[_selectedHospitalIndex].descriptionN!
: model.CitiesModelList[_selectedHospitalIndex].description!
model.CitiesModelList!.isNotEmpty
? projectProvider.isArabic!
? model.CitiesModelList[_selectedHospitalIndex].descriptionN!
: model.CitiesModelList[_selectedHospitalIndex].description!
: "", () {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < model.CitiesModelList.length; i++)
RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN! : model.CitiesModelList[i].description!, i),
RadioSelectionDialogModel(projectProvider.isArabic! ? model.CitiesModelList[i].descriptionN! : model.CitiesModelList[i].description!, i),
];
showDialog(
@ -273,28 +655,90 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
),
),
),
DefaultButton(
TranslationBase.of(context).save,
checkedValue
? () async {
if (_selectedHospital == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return;
}
bloodDetails.city = _selectedHospital.description;
bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.gender = _selectedGenderIndex;
bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
await model.updateBloodGroup(bloodDetails);
if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
} else {
AppToast.showErrorToast(message: model.error);
}
}
: null,
disabledColor: CustomColors.grey2,
).insideContainer
Container(
color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.all(14),
height: 45.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
Navigator.push(context, FadePage(page: BloodDonationBookAppointment()));
},
child: Text(TranslationBase.of(context).bookAppo.toUpperCase(),
style: TextStyle(
fontSize: 16.0,
color: Colors.white,
)),
),
),
),
mWidth(7),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () async {
if (_selectedHospital == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return;
}
bloodDetails.city = _selectedHospital.description;
bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.gender = _selectedGenderIndex;
bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
await model.updateBloodGroup(bloodDetails);
if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
} else {
AppToast.showErrorToast(message: model.error);
}
},
child: Text(TranslationBase.of(context).save.toUpperCase(), style: TextStyle(fontSize: 16.0, color: Colors.white)),
),
),
),
],
),
),
// DefaultButton(
// TranslationBase.of(context).save,
// checkedValue
// ? () async {
// if (_selectedHospital == null) {
// AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
// return;
// }
// bloodDetails.city = _selectedHospital.description;
// bloodDetails.cityCode = _selectedHospital.iD.toString();
// bloodDetails.gender = _selectedGenderIndex;
// bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
// await model.updateBloodGroup(bloodDetails);
// if (model.state == ViewState.Idle) {
// AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
// } else {
// AppToast.showErrorToast(message: model.error);
// }
// }
// : null,
// disabledColor: CustomColors.grey2,
// ).insideContainer
],
),
),

File diff suppressed because one or more lines are too long

@ -0,0 +1,502 @@
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_donation_free_slots_response.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_donation_projects_list_response.dart';
import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation_appointment_terms_conditions.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../AlHabibMedicalService/h2o/h20_setting.dart';
class BloodDonationBookAppointment extends StatefulWidget {
const BloodDonationBookAppointment();
static bool areSlotsAvailable = false;
static DateTime? selectedAppoDateTime;
static String? selectedDate;
static String? selectedTime;
@override
State<BloodDonationBookAppointment> createState() => _BloodDonationBookAppointmentState();
}
class _BloodDonationBookAppointmentState extends State<BloodDonationBookAppointment> with TickerProviderStateMixin {
Map<DateTime, List>? _events;
AnimationController? _animationController;
CalendarController? _calendarController;
List<BloodDonationProjectsListResponse> bloodDonationProjectsListResponse = [];
int _selectedProjectID = 0;
int _clinicID = 0;
int _doctorID = 0;
String selectedProjectName = "";
List<TimeSlot> docFreeSlots = [];
List<TimeSlot> dayEvents = [];
var selectedDate = "";
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
int selectedButtonIndex = 0;
List<BloodDonationFreeSlotsResponseModel> bloodDonationFreeSlotsResponse = [];
ProjectViewModel? projectViewModel;
ScrollController? _scrollController;
var checkedValue = false;
@override
void initState() {
final _selectedDay = DateTime.now();
super.initState();
_events = {
_selectedDay: ['Event A0']
};
_scrollController = new ScrollController();
_calendarController = CalendarController();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 50),
);
WidgetsBinding.instance.addPostFrameCallback((_) {
getBloodDonationProjectsList();
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF7F7F7),
showNewAppBarTitle: true,
isShowDecPage: true,
description: TranslationBase.of(context).bloodDonationInfo,
appBarTitle: TranslationBase.of(context).bloodD,
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(TranslationBase.of(context).selectHospitalBloodDonation, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
mHeight(12),
CommonDropDownView(
TranslationBase.of(context).selectProject,
selectedProjectName,
() {
List<RadioSelectionDialogModel> list = [];
bloodDonationProjectsListResponse.forEach((element) {
list.add(RadioSelectionDialogModel(element.projectName!, element.projectID!));
});
showDialog(
context: context,
builder: (cxt) => RadioSelectionDialog(
listData: list,
selectedIndex: 0,
onValueSelected: (index) {
print(index);
_selectedProjectID = index;
selectedProjectName = bloodDonationProjectsListResponse.firstWhere((element) => element.projectID == index).projectName!;
getBloodDonationFreeSlots();
setState(() {});
},
),
);
},
).withBorderedContainer,
mHeight(12),
Container(
decoration: cardRadius(12),
child: _buildTableCalendarWithBuilders(projectViewModel!),
),
mHeight(12),
Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
mHeight(8),
BloodDonationBookAppointment.areSlotsAvailable
? Container(
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
)
: Center(
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).viewTermsConditions + ":",
style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56),
),
InkWell(
onTap: () {
Navigator.of(context).push(FadePage(page: BloodDonationAppointmentTermsConditions()));
},
child: Text(
TranslationBase.of(context).clickHere,
style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56),
),
)
],
),
SizedBox(height: 12),
Row(
children: [
Checkbox(
onChanged: (bool? value) {
setState(() {
checkedValue = value!;
});
},
value: checkedValue,
activeColor: Color(0xFFc5272d),
),
Text(
TranslationBase.of(context).iAgreeToTheTermsAndConditions,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
),
],
),
],
),
),
),
bottomSheet: Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.081,
width: double.infinity,
padding: EdgeInsets.all(12.0),
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: DefaultButton(
TranslationBase.of(context).bookAppo,
() async {
if (BloodDonationBookAppointment.areSlotsAvailable) {
if (checkedValue) {
insertBloodDonationAppointment();
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
}
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
},
textColor: Colors.white,
color: CustomColors.green,
),
),
],
),
),
);
}
void insertBloodDonationAppointment() {
DoctorsListService service = new DoctorsListService();
final timeSlot = BloodDonationBookAppointment.selectedAppoDateTime;
GifLoaderDialogUtils.showMyDialog(context);
service
.insertAppointment(_doctorID, _clinicID, _selectedProjectID, BloodDonationBookAppointment.selectedTime!, BloodDonationBookAppointment.selectedDate!, 45, projectViewModel!.isArabic ? 1 : 2,
context, null, null, null, projectViewModel)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Navigator.of(context).pop();
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async {
// openAppSettings();
Navigator.pop(context);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
// AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: err,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async {
// openAppSettings();
Navigator.pop(context);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
});
}
void _onDaySelected(DateTime day, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots);
BloodDonationBookAppointment.selectedDate = formatter.format(day);
_calendarController!.selectedDate = day;
print(BloodDonationBookAppointment.selectedDate);
});
}
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return SfCalendar(
controller: _calendarController,
minDate: DateTime.now(),
showNavigationArrow: true,
headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
view: CalendarView.month,
todayHighlightColor: CustomColors.green,
selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
cellBorderColor: Colors.white,
dataSource: MeetingDataSource(_getDataSource()),
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) {
_calendarController!.selectedDate = details.date;
_onDaySelected(details.date!, projectViewModel);
},
);
}
Widget getNormalButton(int index) {
return CustomTextButton(
backgroundColor: Colors.white,
elevation: 0,
side: BorderSide(
color: Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5 //width of the border
),
onPressed: () {
final timeslot = dayEvents[index];
BloodDonationBookAppointment.selectedAppoDateTime = timeslot.end;
setState(() {
selectedButtonIndex = index;
BloodDonationBookAppointment.selectedTime = dayEvents[index].isoTime;
print(BloodDonationBookAppointment.selectedTime);
});
},
child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, color: Color(0xFF60686b))),
);
}
Widget getSelectedButton(int index) {
return CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
side: BorderSide(
color: CustomColors.green, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5 //width of the border
),
onPressed: () {
setState(() {
selectedButtonIndex = index;
BloodDonationBookAppointment.selectedTime = dayEvents[index].isoTime;
print(BloodDonationBookAppointment.selectedTime);
});
},
child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, color: Colors.white)),
);
}
getBloodDonationFreeSlots() {
BloodDonationService service = new BloodDonationService();
GifLoaderDialogUtils.showMyDialog(context);
service.getBloodDonationFreeSlots(134, _selectedProjectID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
res['BD_FreeSlots'].forEach((element) {
bloodDonationFreeSlotsResponse.add(BloodDonationFreeSlotsResponseModel.fromJson(element));
});
print(bloodDonationFreeSlotsResponse.length);
_getJSONSlots().then((value) => {
setState(() => {_clinicID = bloodDonationFreeSlotsResponse[0].clinicID!, _doctorID = bloodDonationFreeSlotsResponse[0].doctorID!, _events!.clear(), _events = value})
});
} else {
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear();
DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v);
});
setState(() {
if (dayEvents.length != 0) {
BloodDonationBookAppointment.areSlotsAvailable = true;
selectedButtonIndex = 0;
BloodDonationBookAppointment.selectedTime = dayEvents[selectedButtonIndex].isoTime;
} else
BloodDonationBookAppointment.areSlotsAvailable = false;
});
}
Future<Map<DateTime, List>> _getJSONSlots() async {
Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = [];
DateTime date;
final DateFormat formatter = DateFormat('HH:mm');
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
for (var i = 0; i < bloodDonationFreeSlotsResponse.length; i++) {
date = DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[i].freeTimeSlots);
slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date));
}
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
BloodDonationBookAppointment.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[0].freeTimeSlots));
selectedDate = DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[0].freeTimeSlots));
selectedDateJSON = bloodDonationFreeSlotsResponse[0].freeTimeSlots;
});
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController!.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
return _eventsParsed;
}
getBloodDonationProjectsList() {
BloodDonationService service = new BloodDonationService();
GifLoaderDialogUtils.showMyDialog(context);
service.getBloodDonationProjectsList().then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['BD_getProjectsHaveBDClinics']);
if (res["MessageStatus"] == 1) {
res['BD_getProjectsHaveBDClinics'].forEach((element) {
bloodDonationProjectsListResponse.add(BloodDonationProjectsListResponse.fromJson(element));
});
print(bloodDonationProjectsListResponse.length);
} else {
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
List<Meeting> _getDataSource() {
final List<Meeting> meetings = <Meeting>[];
_events!.forEach((key, value) {
final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
final DateTime endTime = startTime.add(const Duration(minutes: 20));
meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
});
return meetings;
}
}
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments![index];
Meeting? meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meetingData!;
}
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
}

@ -700,27 +700,32 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
if (res["MessageStatus"] == 1) {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);

@ -119,6 +119,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.clinicID == 47 ||
widget.appo.clinicID == 23 ||
widget.appo.clinicID == 265 ||
widget.appo.clinicID == 134 ||
widget.appo.isExecludeDoctor! ||
widget.appo.isLiveCareAppointment!)
? false
@ -152,15 +153,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
setState(() {
if (index == 1) {
if (widget.appo.clinicID == 17 ||
widget.appo.clinicID == 47 ||
widget.appo.clinicID == 23 ||
widget.appo.clinicID == 253 ||
widget.appo.clinicID == 265 ||
widget.appo.isExecludeDoctor != null
? widget.appo.isExecludeDoctor!
: false || widget.appo.isLiveCareAppointment != null
? widget.appo.isLiveCareAppointment!
: false) {
widget.appo.clinicID == 47 ||
widget.appo.clinicID == 23 ||
widget.appo.clinicID == 253 ||
widget.appo.clinicID == 265 ||
widget.appo.clinicID == 134 ||
widget.appo.isExecludeDoctor! ||
widget.appo.isLiveCareAppointment!) {
_tabController!.index = _tabController!.previousIndex;
AppointmentDetails.showFooterButton = false;
} else {

@ -80,9 +80,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
shrinkWrap: true,
itemBuilder: (context, index) {
// bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule");
bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") ||
bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 134) && appoButtonsList[index].caller == "openReschedule") ||
(widget.appo.isLiveCareAppointment! && appoButtonsList[index].caller == "askDoc") ||
(Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID!) &&
(Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) &&
widget.appo.clinicID == 10 &&
(appoButtonsList[index].caller == "prescriptions" || appoButtonsList[index].caller == "radiology" || appoButtonsList[index].caller == "labResult")));
return InkWell(

@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation_appointment_terms_conditions.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
@ -175,212 +176,189 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
title: TranslationBase.of(context).appointments,
bodyWidget: appoList.length != 0
? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: appoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: appoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: appoList[index].clinicID == 265
? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
)
: appoList[index].isLiveCareAppointment!
? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo
: appoList[index].isLiveCareAppointment!
? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer(
controller:
new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay! * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime? time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48))
: Container();
},
),
),
],
),
],
),
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: appoList[index].clinicID == 265
? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
)
: appoList[index].isLiveCareAppointment!
? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
),
Expanded(
child: Container(
child: InkWell(
onTap: () {
performNextAction(appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: getNextActionButtonColor(appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
getNextActionText(appoList[index].nextAction),
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo
: appoList[index].isLiveCareAppointment!
? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer(
controller:
new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay! * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime? time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48))
: Container();
},
),
),
),
],
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Expanded(
child: Container(
child: InkWell(
onTap: () {
performNextAction(appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: getNextActionButtonColor(appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
getNextActionText(appoList[index].nextAction),
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
),
Row(
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
url: appoList[index].doctorImageURL,
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
url: appoList[index].doctorImageURL,
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName!, projectViewModel.isArabic),
// MyRichText(TranslationBase.of(context).appointmentDate + ": ",
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// Timezone changes
appoList[index].isLiveCareAppointment!
? MyRichText(
TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " +
DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
projectViewModel.isArabic)
: MyRichText(
TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " +
appoList[index].startTime!.substring(0, 5),
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, appoList[index].projectName!, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
// RatingBar.readOnly(
// initialRating: widget.appoList[index].actualDoctorRate!.toDouble(),
// size: 16.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star_border,
// ),
RatingBar(
itemSize: 20.0,
allowHalfRating: true,
initialRating: appoList[index].actualDoctorRate!.toDouble(),
ratingWidget: RatingWidget(
full: Icon(
Icons.star,
color: CustomColors.accentColor,
),
half: Icon(
Icons.star_half,
color: CustomColors.accentColor,
),
empty: Icon(
Icons.star_border,
color: CustomColors.accentColor,
),
),
onRatingUpdate: (double value) {},
unratedColor: Colors.grey[500],
updateOnDrag: false,
tapOnlyMode: false,
),
],
),
],
),
MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName!, projectViewModel.isArabic),
// MyRichText(TranslationBase.of(context).appointmentDate + ": ",
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// Timezone changes
appoList[index].isLiveCareAppointment!
? MyRichText(
TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " +
DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
projectViewModel.isArabic)
: MyRichText(
TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " +
appoList[index].startTime!.substring(0, 5),
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, appoList[index].projectName!, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar(
initialRating: appoList[index].actualDoctorRate.toDouble(),
itemSize: 16.0,
glowColor: Color(0XFFD02127),
unratedColor: Color(0XFFD02127),
allowHalfRating: true, ratingWidget: RatingWidget(full:Icon(Icons.star), half: Icon(Icons.star_half), empty: Icon( Icons.star_border)), onRatingUpdate: (double value) { },
// : Icons.star_half,
// ic: Icons.star,
// emptyIcon: Icons.star_border, itemBuilder: (BuildContext context, int index) { },
),
],
),
],
),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
getNextActionDescription(appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
),
),
InkWell(
onTap: () {
navigateToAppointmentDetails(context, appoList[index]);
},
child: Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Text(
TranslationBase.of(context).moreDetails,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w600,
color: CustomColors.accentColor,
letterSpacing: -0.48,
height: 25 / 16,
decoration: TextDecoration.underline),
),
),
),
],
),
],
),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
getNextActionDescription(appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
),
);
},
)
),
InkWell(
onTap: () {
navigateToAppointmentDetails(context, appoList[index]);
},
child: Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Text(
TranslationBase.of(context).moreDetails,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w600,
color: CustomColors.accentColor,
letterSpacing: -0.48,
height: 25 / 16,
decoration: TextDecoration.underline),
),
),
),
],
),
);
},
)
: getNoDataWidget(context),
),
),
@ -393,28 +371,28 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: ancillaryLists.length != 0
? Container(
padding: EdgeInsets.all(12),
child: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
reverse: true,
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList![index], ancillaryLists[0].projectID),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
billNo: ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: ancillaryLists[0].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList![index].orderDate),
isSortByClinic: true,
);
},
itemCount: ancillaryLists[0].ancillaryOrderList!.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
)
padding: EdgeInsets.all(12),
child: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
reverse: true,
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList![index], ancillaryLists[0].projectID),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
billNo: ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: ancillaryLists[0].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList![index].orderDate),
isSortByClinic: true,
);
},
itemCount: ancillaryLists[0].ancillaryOrderList!.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
)
: getNoDataWidget(context),
)),
],
@ -423,104 +401,104 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Container(
child: obGyneAppoList.length != 0
? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: obGyneAppoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
],
),
],
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: obGyneAppoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/ultrasound.svg", width: 20.0, height: 20.0),
),
Container(
child: InkWell(
onTap: () {
getOBGyneDoctorsList(obGyneAppoList[index].projectID!, obGyneAppoList[index].setupID!, obGyneAppoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: CustomColors.green,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
],
),
],
),
Container(
child: InkWell(
onTap: () {
getOBGyneDoctorsList(obGyneAppoList[index].projectID!, obGyneAppoList[index].setupID!, obGyneAppoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: CustomColors.green,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52,
height: 52,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
MyRichText(
TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
],
),
),
MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
MyRichText(
TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
],
),
],
),
);
},
)
),
],
),
],
),
);
},
)
: getNoDataWidget(context),
),
],
@ -554,23 +532,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
case 30:
return "assets/images/new-design/NFCIcon_option2.png";
break;
case 40:
return "assets/images/new-design/video_call_instruction.png";
break;
case 50:
return "assets/images/new-design/confirm_button.png";
break;
case 60:
return "assets/images/new-design/waiting_for_doctor.png";
break;
case 90:
return "assets/images/new-design/NFCIcon_option2.png";
break;
default:
return "";
}
@ -579,7 +552,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
performNextAction(AppoitmentAllHistoryResultList appo) {
switch (appo.nextAction) {
case 0:
// getAppoQR(context, appo);
// getAppoQR(context, appo);
break;
case 10:
confirmAppointment(appo);
@ -594,6 +567,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
case 30:
getAppoQR(context, appo);
break;
case 40:
openInstructions(appo);
break;
case 50:
confirmAppointment(appo);
break;
@ -605,6 +582,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
}
openInstructions(AppoitmentAllHistoryResultList appo) {
if (appo.clinicID == 134) {
Navigator.of(context).push(FadePage(page: BloodDonationAppointmentTermsConditions()));
}
}
Color getNextActionButtonColor(nextAction) {
switch (nextAction) {
case 0:
@ -1092,12 +1075,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PaymentDialog(
appo: appo,
patientShareResponse: patientShareResponse,
onPaymentMethodSelected: () {},
isCashPatient: isCash,
),
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, isCashPatient: isCash, onPaymentMethodSelected: (){},),
),
);
},
@ -1105,9 +1083,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
barrierDismissible: false,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {
return SizedBox();
}).then((value) {
pageBuilder: (context, animation1, animation2) =>SizedBox())
.then((value) {
if (value != null) {
navigateToPaymentMethod(context, value as PatientShareResponse, appo);
projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo);
@ -1351,13 +1328,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
Navigator.push(
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse!.patientShareWithTax)))
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse!.patientShareWithTax)))
.then((value) {
print(value);
selectedPaymentMethod = value[0] ?? "";
@ -1435,27 +1412,32 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
if (res["MessageStatus"] == 1) {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
@ -1490,7 +1472,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService();
service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {

@ -410,29 +410,34 @@ class _clinic_listState extends State<ClinicList> {
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async {
await localContext!.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
GifLoaderDialogUtils.hideDialog(localContext!);
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
GifLoaderDialogUtils.hideDialog(localContext!);
log("Payfort: ${successResult.responseMessage}");
await localContext!.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
if (res["MessageStatus"] == 1) {
await localContext!.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
GifLoaderDialogUtils.hideDialog(localContext!);
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
GifLoaderDialogUtils.hideDialog(localContext!);
log("Payfort: ${successResult.responseMessage}");
await localContext!.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(localContext!);

@ -318,27 +318,32 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user!.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${widget.advanceModel!.fileNumber}@HMG.com",
orderDescription: "Advance Payment",
orderAmount: double.parse(widget.advanceModel!.amount!),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(int.parse(widget.advanceModel!.fileNumber!), result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.advanceModel!.hospitalsModel!.iD,
serviceTypeEnum: ServiceTypeEnum.advancePayment,
);
if (res["MessageStatus"] == 1) {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${widget.advanceModel!.fileNumber!}@HMG.com",
orderDescription: "Advance Payment",
orderAmount: double.parse(widget.advanceModel!.amount!),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(num.parse(widget.advanceModel!.fileNumber!), result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.advanceModel!.hospitalsModel!.iD,
serviceTypeEnum: ServiceTypeEnum.advancePayment,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);

@ -2960,6 +2960,7 @@ class TranslationBase {
String get noUpcomingAppointment => localizedValues["noUpcomingAppointment"][locale.languageCode];
String get locationTimeoutError => localizedValues["locationTimeoutError"][locale.languageCode];
String get loadMore => localizedValues["loadMore"][locale.languageCode];
String get selectHospitalBloodDonation => localizedValues["selectHospitalBloodDonation"][locale.languageCode];
}

@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS
@ -230,7 +230,7 @@ class MyInAppBrowser extends InAppBrowser {
service.tamaraInsertRequest(tamaraRequestModel, context).then((res) {
if (context != null) GifLoaderDialogUtils.hideDialog(context);
generateTamaraURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate,
appoNo, clinicID, doctorID, "", installments)
appoNo, clinicID, doctorID, "", installments)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions);
@ -242,7 +242,7 @@ class MyInAppBrowser extends InAppBrowser {
});
} else {
generateURL(amount, orderDesc, transactionID, projId, emailId, paymentMethod, patientType, patientName, patientID, authenticatedUser, isLiveCareAppo, servID, LiveServID, appoDate, appoNo,
clinicID, doctorID)
clinicID, doctorID)
.then((value) {
paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions);

@ -80,9 +80,9 @@ class DoctorHeader extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_speciality.isNotEmpty)
if (_speciality != null && _speciality.isNotEmpty)
Text(
_speciality,
_speciality != "null" ? _speciality : "",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
),
headerModel.invoiceNo.isNotEmpty ? MyRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo, projectViewModel.isArabic) : Container(),

Loading…
Cancel
Save