From 27c6837f253e3620c3824d3c65387ab736d7c628 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 12 Jun 2022 17:01:24 +0300 Subject: [PATCH 1/4] updates & fixes --- lib/config/config.dart | 6 + lib/config/localized_values.dart | 54 +++-- lib/config/shared_pref_kay.dart | 1 + lib/core/model/er/ErPatientShareModel.dart | 6 +- .../prescriptions/prescription_report.dart | 2 +- .../prescription_report_enh.dart | 2 +- .../service/ancillary_orders_service.dart | 5 + lib/core/service/client/base_app_client.dart | 6 +- lib/core/service/er/EdOnlineServices.dart | 61 ++---- .../medical/prescriptions_view_model.dart | 2 + .../ancillaryOrdersDetails.dart | 50 ++++- lib/pages/Blood/confirm_payment_page.dart | 73 ++----- .../covid-drivethru-location.dart | 110 +++++----- .../ErService/EdOnline/DdServicesPage.dart | 31 +-- .../ErService/EdOnline/EdOnlineNotesPage.dart | 48 +++-- .../EdOnlineSelectedHospitalPage.dart | 190 ++++++++++++------ .../EdOnline/EdPaymentInformationPage.dart | 169 +++++++++++----- lib/pages/ErService/ErOptions.dart | 5 +- .../prescription_items_page.dart | 7 +- .../appointment_services/GetDoctorsList.dart | 93 ++++++++- lib/widgets/in_app_browser/InAppBrowser.dart | 8 +- 21 files changed, 581 insertions(+), 348 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index ac610ee9..c8a48ef8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -318,6 +318,12 @@ var CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; var HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; +var ER_CREATE_ADVANCE_PAYMENT = + "services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic"; + +var ER_INSERT_ADVANCE_PAYMENT = + "services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails"; + var ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b0c7213f..8223bee6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -88,7 +88,7 @@ const Map localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'}, - 'agreeTo': {'en': 'I agree the', 'ar': 'أوافق على'}, + 'agreeTo': {'en': 'I agree to the', 'ar': 'أوافق على'}, 'termsConditoins': {'en': 'Terms and Conditions', 'ar': 'الأحكام والشروط'}, 'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'}, 'changePayment': {'en': 'Change Payment Method', 'ar': 'تغيير آلية الدفع'}, @@ -1385,9 +1385,9 @@ const Map localizedValues = { "ancillary-orders": {"en": "Ancillary Orders", "ar": "الطلبات الاضافية"}, "onlineCheckInAgreement": { "en": - "The online check-in is for non-life threatening situationCall the red crescent (number) or go to the nearest emergency department if there are: signs of stroke or heart attack history of seizure or syncope there is limb or life threatening injury picture of severe injuries​", + "The online check-in is for non-life threatening situation. Call the red crescent (number) or go to the nearest emergency department if there are: \n\nsigns of stroke or heart attack \nhistory of seizure or syncope \nthere is limb or life threatening injury \npicture of severe injuries", "ar": - "تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة" + "تسجيل الذهاب الى الطوارئ عبر الإنترنت هو فقط للحالات التي لا تهدد الحياة يجب الاتصل بالهلال الأحمر (رقم) أو الذهاب إلى أقرب قسم طوارئ إذا كان هناك علامات السكتة الدماغية أو النوبة القلبية او هناك نوبة تشنج او حالة فقدان الوعي او وجود إصابة تهدد أحد الأطراف او تهدد الحياة او وجود إصابات خطيرة" }, "MRN": {"en": "MRN", "ar": "رقم الملف الطبي"}, "appointment-date": {"en": "Appointment Date", "ar": "تاريخ الموعد"}, @@ -1803,17 +1803,45 @@ const Map localizedValues = { "تتيح لك ميزة اختبار كوفيد19 حجز موعد في احد فروع مجموعة الحبيب الطبية ، حيث سيتم اخذ عينة المسحة ومعالجتها. بمجرد معالجة النتيجة ، سنخطرك عبر رسالة نصية قصيرة على رقم هاتفك المحمول المسجل وستكون نتيجة الاختبار متاحة أيضًا على التطبيق في قسم نتائج المختبر. يرجى ملاحظة أن هذه النتيجة متاحة لك فقط وليست متاحة للجمهور او اي شخص آخر. الرجاء الموافقة للتأكيد والمتابعة." }, "covidConsentHeader": {"en": "User Consent", "ar": "موافقة المستخدم"}, - "drawOverAppsPermission": {"en": "Please allow the Al-Habib Medical Group application to appear on the top of the screen when receiving the call from the doctor for LiveCare service.", "ar": "الرجاء السماح لتطبيق مجموعة الحبيب الطبية للظهورعلى سطح الشاشة عند استلام الاتصال من الطبيب لخدمة اللايف كير"}, - "cameraPermissionDialog": { "en": "Dr. Al Habib app needs to access Camera to enable virtual consultation between patient & doctor, attach images and scan QR for parking service.", "ar": "يحتاج تطبيق دكتور الحبيب الى صلاحية الوصول إلى الكاميرا لخدمة الاستشارة الافتراضية بين المريض والطبيب وإرفاق الصور ومسح رمز الاستجابة السريع لخدمة مواقف السيارات." }, - "galleryPermission": { "en": "Dr. Al Habib app needs to access Read & write external storage to upload images & documents in the E-Referral module and renew and update the insurance cards.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول إلى معرض الصور وذلك لتحميل الصور والمستندات لخدمة الإحالة الإلكترونية وكذلك لخدمة تجديد بطاقات التأمين وتحديثها." }, - "locationPermissionDialog": { "en": "Dr. Al Habib app collects location data to show the nearest HMG hospitals and ER Locations and provides health care services to your location and Health weather indicators service and the medication delivery.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الموقع لإظهار أقرب مستشفيات المجموعة، مواقع الطوارئ، تقديم خدمات الرعاية الصحية إلى موقعك، خدمة مؤشرات الطقس الصحية وكذلك خدمة توصيل الأدوية." }, - "calendarPermission": { "en": "Dr. Al Habib app collects calendar data to modify and set reminders for Appointments", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى التقويم وذلك لاضافة تذكيرات بالمواعيد في التقويم." }, - "recordAudioPermission": { "en": "Dr. Al Habib app needs audio permission to enable voice command features.", "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الصوت لتفعيل خدمة الأوامر الصوتية." }, - "wifiPermission": { "en": "Dr. Al Habib app needs to access WiFi state permission to connect to the HMG WiFi network from within the app when you visit the hospital.", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى الواي فاي للاتصال بشبكة الواي فاي في المجموعة عند زيارة المستشفى." }, - "physicalActivityPermission": { "en": "Dr. Al Habib app collects physical activity data to read heart rate, steps & distance from your smartwatch & send it to your doctor.", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى بيانات النشاط البدني لقراءة معدل ضربات القلب والخطوات والمسافة من ساعتك الذكية وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." }, - "bluetoothPermission": { "en": "Dr. Al Habib app needs to access Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data", "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." }, + "drawOverAppsPermission": { + "en": "Please allow the Al-Habib Medical Group application to appear on the top of the screen when receiving the call from the doctor for LiveCare service.", + "ar": "الرجاء السماح لتطبيق مجموعة الحبيب الطبية للظهورعلى سطح الشاشة عند استلام الاتصال من الطبيب لخدمة اللايف كير" + }, + "cameraPermissionDialog": { + "en": "Dr. Al Habib app needs to access Camera to enable virtual consultation between patient & doctor, attach images and scan QR for parking service.", + "ar": "يحتاج تطبيق دكتور الحبيب الى صلاحية الوصول إلى الكاميرا لخدمة الاستشارة الافتراضية بين المريض والطبيب وإرفاق الصور ومسح رمز الاستجابة السريع لخدمة مواقف السيارات." + }, + "galleryPermission": { + "en": "Dr. Al Habib app needs to access Read & write external storage to upload images & documents in the E-Referral module and renew and update the insurance cards.", + "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول إلى معرض الصور وذلك لتحميل الصور والمستندات لخدمة الإحالة الإلكترونية وكذلك لخدمة تجديد بطاقات التأمين وتحديثها." + }, + "locationPermissionDialog": { + "en": + "Dr. Al Habib app collects location data to show the nearest HMG hospitals and ER Locations and provides health care services to your location and Health weather indicators service and the medication delivery.", + "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الموقع لإظهار أقرب مستشفيات المجموعة، مواقع الطوارئ، تقديم خدمات الرعاية الصحية إلى موقعك، خدمة مؤشرات الطقس الصحية وكذلك خدمة توصيل الأدوية." + }, + "calendarPermission": { + "en": "Dr. Al Habib app collects calendar data to modify and set reminders for Appointments", + "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى التقويم وذلك لاضافة تذكيرات بالمواعيد في التقويم." + }, + "recordAudioPermission": { + "en": "Dr. Al Habib app needs audio permission to enable voice command features.", + "ar": "يحتاج تطبيق دكتور الحبيب إلى صلاحية الوصول الى الصوت لتفعيل خدمة الأوامر الصوتية." + }, + "wifiPermission": { + "en": "Dr. Al Habib app needs to access WiFi state permission to connect to the HMG WiFi network from within the app when you visit the hospital.", + "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى الواي فاي للاتصال بشبكة الواي فاي في المجموعة عند زيارة المستشفى." + }, + "physicalActivityPermission": { + "en": "Dr. Al Habib app collects physical activity data to read heart rate, steps & distance from your smartwatch & send it to your doctor.", + "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى بيانات النشاط البدني لقراءة معدل ضربات القلب والخطوات والمسافة من ساعتك الذكية وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." + }, + "bluetoothPermission": { + "en": "Dr. Al Habib app needs to access Bluetooth permission to connect blood pressure & blood sugar devices with the app to analyze the data", + "ar": "يحتاج تطبيق دكتور الحبيب إلى الوصول إلى البلوتوث لربط أجهزة ضغط الدم وسكر الدم بالتطبيق لتحليل البيانات وتحميلها على ملفك الطبي حتى يتمكن الطبيب من الاطلاع عليها." + }, "privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"}, "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."}, - "liveCarePermissions": {"en": "LiveCare required Camera & Microphone permissions, Please allow these to proceed.", "ar": "هذه العيادة لا تدعم خدمة إعادة التعبئة والتسليم."}, + "liveCarePermissions": {"en": "LiveCare requires Camera & Microphone permissions, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون ، يرجى السماح لها بالمتابعة."}, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index d5fb7e3b..8ae7e20b 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -7,6 +7,7 @@ const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register'; const LOGIN_TOKEN_ID = 'register-data-for-register'; const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login'; const LAST_LOGIN = 'last-login'; +const ER_CHECKIN_RISK_SCORE = 'er-checkin-risk-score'; const ONLY_SMS = 'only-sms'; const AUTH_DATA = 'auth-data'; const IMEI_USER_DATA = 'imei-user-data'; diff --git a/lib/core/model/er/ErPatientShareModel.dart b/lib/core/model/er/ErPatientShareModel.dart index 4c6a4165..09e54de9 100644 --- a/lib/core/model/er/ErPatientShareModel.dart +++ b/lib/core/model/er/ErPatientShareModel.dart @@ -10,9 +10,9 @@ class ErPatientShareModel { dynamic insurancePolicyNo; String message; dynamic patientCardID; - double patientShare; - double patientShareWithTax; - double patientTaxAmount; + num patientShare; + num patientShareWithTax; + num patientTaxAmount; int policyId; String policyName; String procedureName; diff --git a/lib/core/model/prescriptions/prescription_report.dart b/lib/core/model/prescriptions/prescription_report.dart index c521bede..3eb30825 100644 --- a/lib/core/model/prescriptions/prescription_report.dart +++ b/lib/core/model/prescriptions/prescription_report.dart @@ -7,7 +7,7 @@ class PrescriptionReport { String companyName; int days; String doctorName; - var doseDailyQuantity; + num doseDailyQuantity; String frequency; int frequencyNumber; String image; diff --git a/lib/core/model/prescriptions/prescription_report_enh.dart b/lib/core/model/prescriptions/prescription_report_enh.dart index 01a34c47..a43c56b2 100644 --- a/lib/core/model/prescriptions/prescription_report_enh.dart +++ b/lib/core/model/prescriptions/prescription_report_enh.dart @@ -5,7 +5,7 @@ class PrescriptionReportEnh { Null companyName; int days; String doctorName; - int doseDailyQuantity; + num doseDailyQuantity; String frequency; int frequencyNumber; Null image; diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index c068ad3e..36cac50e 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -10,6 +10,11 @@ class AncillaryOrdersService extends BaseService { List get ancillaryProcLists => _ancillaryProcLists; + String _insuranceCompanyName = ""; + String get insuranceCompanyName => _insuranceCompanyName; + String _insurancePolicyNumber = ""; + String get insurancePolicyNumber => _insurancePolicyNumber; + Future getOrders() async { Map body = Map(); diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 50370b52..cc570bd1 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -132,7 +132,7 @@ class BaseAppClient { // body['IdentificationNo'] = 2076117163; // body['MobileNo'] = "966503109207"; - // body['PatientID'] = 50121262; //3844083 + // body['PatientID'] = 1018977; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 @@ -141,11 +141,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (BASE_URL == "https://uat.hmgwebservices.com/") { + // if (BASE_URL == "https://uat.hmgwebservices.com/") { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - } + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/core/service/er/EdOnlineServices.dart b/lib/core/service/er/EdOnlineServices.dart index 2df92d8a..12585e4c 100644 --- a/lib/core/service/er/EdOnlineServices.dart +++ b/lib/core/service/er/EdOnlineServices.dart @@ -1,19 +1,21 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/er/ErPatientShareModel.dart'; import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/cupertino.dart'; class EdOnlineServices extends BaseService { List triageQuestionsModelList = List(); ErPatientShareModel erPatientShareModel; Future getQuestions() async { - hasError =false; + hasError = false; triageQuestionsModelList.clear(); Map body = Map(); body['ProjectID'] = 15; - await baseAppClient.post(ER_GET_VISUAL_TRIAGE_QUESTIONS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(ER_GET_VISUAL_TRIAGE_QUESTIONS, onSuccess: (dynamic response, int statusCode) { triageQuestionsModelList.clear(); response['ER_TriageQuestionsList'].forEach((questions) { triageQuestionsModelList.add(TriageQuestionsModel.fromJson(questions)); @@ -24,26 +26,19 @@ class EdOnlineServices extends BaseService { }, body: body); } - Future getPatientPaymentInformation({var id}) async { - hasError =false; - await baseAppClient.post(ER_GetPatientPaymentInformationForERClinic, - onSuccess: (dynamic response, int statusCode) { - erPatientShareModel = - ErPatientShareModel.fromJson(response['ER_PatientShare']); + hasError = false; + await baseAppClient.post(ER_GetPatientPaymentInformationForERClinic, onSuccess: (dynamic response, int statusCode) { + erPatientShareModel = ErPatientShareModel.fromJson(response['ER_PatientShare']); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map.from({"ProjectID":15,"ClinicID":10})); + }, body: Map.from({"ProjectID": 15, "ClinicID": 10})); } - Future saveQuestionsInformation( - {String notes, - String chiefComplaint, - int projectId, - DateTime selectedTime, - List selectedQuestions}) async { - hasError =false; + Future saveQuestionsInformation({String notes, String chiefComplaint, int projectId, DateTime selectedTime, List selectedQuestions}) async { + AppSharedPreferences sharedPref = AppSharedPreferences(); + hasError = false; Map body = Map(); List checklist = List(); @@ -53,27 +48,15 @@ class EdOnlineServices extends BaseService { if (user.age > 14) { selectedQuestions.forEach((element) { - int score = int.parse(element.adultPoints); + int score = int.parse((element.adultPoints != "" ? element.adultPoints : "0")); riskScore += score; - checklist.add(Map.from({ - "IsSelected": 1, - "ParameterCode": element.parameterCode, - "ParameterGroup": element.parameterGroup, - "ParameterType": element.parameterType, - "Score": score - })); + checklist.add(Map.from({"IsSelected": 1, "ParameterCode": element.parameterCode, "ParameterGroup": element.parameterGroup, "ParameterType": element.parameterType, "Score": score})); }); } else { selectedQuestions.forEach((element) { int score = int.parse(element.pediaPoints); riskScore += score; - checklist.add(Map.from({ - "IsSelected": 1, - "ParameterCode": element.parameterCode, - "ParameterGroup": element.parameterGroup, - "ParameterType": element.parameterType, - "Score": score - })); + checklist.add(Map.from({"IsSelected": 1, "ParameterCode": element.parameterCode, "ParameterGroup": element.parameterGroup, "ParameterType": element.parameterType, "Score": score})); }); } @@ -81,16 +64,16 @@ class EdOnlineServices extends BaseService { "Notes": notes, "ChiefComplaint": chiefComplaint, "PatientId": user.patientID, - "ProjectId": 15, + "ProjectId": projectId, "RiskScore": riskScore, "checklist": checklist.map((e) => e).toList() }; - await baseAppClient.post(ER_SAVE_TRIAGE_INFORMATION, - onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + sharedPref.setInt(ER_CHECKIN_RISK_SCORE, riskScore); + + await baseAppClient.post(ER_SAVE_TRIAGE_INFORMATION, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } } diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index dd1030c6..98a5b1b7 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -24,6 +24,8 @@ class PrescriptionsViewModel extends BaseViewModel { List get prescriptionReportList => _prescriptionsService.prescriptionReportList; + + List get prescriptionReportListINP => _prescriptionsService.prescriptionReportListINP; List get prescriptionsList => _prescriptionsService.prescriptionsList; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 5354ff35..1871e1ee 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -280,6 +280,52 @@ class _AnicllaryOrdersState extends State with SingleTic ), ], ), + mWidth(3), + Row( + children: [ + Text( + TranslationBase.of(context).insuranceCompany + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 10, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + model.ancillaryListsDetails[0].companyName.toString(), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), + mWidth(3), + Row( + children: [ + Text( + TranslationBase.of(context).policyNo + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 10, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + model.ancillaryListsDetails[0].insurancePolicyNo.toString(), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.48, + ), + ), + ], + ), ], ), ), @@ -504,7 +550,7 @@ class _AnicllaryOrdersState extends State with SingleTic DoctorsListService service = new DoctorsListService(); service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo']); + showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo'], widget.projectID); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); @@ -512,7 +558,7 @@ class _AnicllaryOrdersState extends State with SingleTic }); } - showAlertDialog(dynamic invoiceNo) { + showAlertDialog(dynamic invoiceNo, dynamic projectID) { AlertDialogBox( context: context, confirmMessage: TranslationBase.of(context).ancillaryOrderPaymentSuccess + invoiceNo.toString(), diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 51142817..15056bd0 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -32,11 +32,7 @@ class ConfirmPaymentPage extends StatelessWidget { AuthenticatedUser authenticatedUser; AppSharedPreferences sharedPref = AppSharedPreferences(); - ConfirmPaymentPage( - {this.advanceModel, - this.patientInfoAndMobileNumber, - this.selectedPaymentMethod, - this.authenticatedUser}); + ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); @override Widget build(BuildContext context) { @@ -51,11 +47,9 @@ class ConfirmPaymentPage extends StatelessWidget { print("dialog dismissed"); print(value); if (value != null && value) { - AppoitmentAllHistoryResultList appo = - new AppoitmentAllHistoryResultList(); + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = patientInfoAndMobileNumber.projectID; - openPayment(selectedPaymentMethod, authenticatedUser, - double.parse(advanceModel.amount), appo); + openPayment(selectedPaymentMethod, authenticatedUser, double.parse(advanceModel.amount), appo); } }); } @@ -161,14 +155,9 @@ class ConfirmPaymentPage extends StatelessWidget { disabled: model.state == ViewState.Busy, onTap: () { GifLoaderDialogUtils.showMyDialog(context); - model - .sendActivationCodeForAdvancePayment( - patientID: int.parse(advanceModel.fileNumber), - projectID: advanceModel.hospitalsModel.iD) - .then((value) { + model.sendActivationCodeForAdvancePayment(patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD).then((value) { GifLoaderDialogUtils.hideDialog(context); - if (model.state != ViewState.ErrorLocal && - model.state != ViewState.Error) showSMSDialog(); + if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); }); }, ), @@ -202,29 +191,11 @@ class ConfirmPaymentPage extends StatelessWidget { return 'assets/images/new-design/mada.png'; } - openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, - double amount, AppoitmentAllHistoryResultList appo) { - browser = new MyInAppBrowser( - onExitCallback: onBrowserExit, - appo: appo, - onLoadStartCallback: onBrowserLoadStart); + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); - browser.openPaymentBrowser( - amount, - "Advance Payment", - Utils.getAdvancePaymentTransID( - authenticatedUser.projectID, authenticatedUser.patientID), - appo.projectID.toString(), - authenticatedUser.emailAddress, - paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName, - authenticatedUser.patientID, - authenticatedUser, - browser, - false, - "3", - ""); + browser.openPaymentBrowser(amount, "Advance Payment", Utils.getAdvancePaymentTransID(authenticatedUser.projectID, authenticatedUser.patientID), appo.projectID.toString(), + authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); } onBrowserLoadStart(String url) { @@ -256,12 +227,7 @@ class ConfirmPaymentPage extends StatelessWidget { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - service - .checkPaymentStatus( - Utils.getAppointmentTransID( - appo.projectID, appo.clinicID, appo.appointmentNo), - AppGlobal.context) - .then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); print("Printing Payment Status Reponse!!!!"); print(res); @@ -282,17 +248,10 @@ class ConfirmPaymentPage extends StatelessWidget { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - service - .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], - res['Fort_id'], res['PaymentMethod'], AppGlobal.context) - .then((res) { + service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); - addAdvancedNumberRequest( - res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), - paymentReference, - appo.appointmentNo.toString(), - appo); + addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); @@ -300,14 +259,10 @@ class ConfirmPaymentPage extends StatelessWidget { }); } - addAdvancedNumberRequest(String advanceNumber, String paymentReference, - String appointmentID, AppoitmentAllHistoryResultList appo) { + addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - service - .addAdvancedNumberRequest( - advanceNumber, paymentReference, appointmentID, AppGlobal.context) - .then((res) { + service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res); navigateToHome(AppGlobal.context); diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index e1ddad8e..85e913e8 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -86,69 +86,63 @@ class _CovidDrivethruLocationState extends State { margin: EdgeInsets.only(top: 6.0), child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 14.0, color: Colors.black, letterSpacing: -0.56)), ), - InkWell( - onTap: () { - // dropdownKey.currentState; - // openDropdown(clinicDropdownKey); - }, - child: Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(top: 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Row( - children: [ - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).selectLocation, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(top: 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectLocation, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, ), - Container( - height: 20, - child: DropdownButtonHideUnderline( - child: DropdownButton( - onTap: () { - print("Clicked"); - }, - key: locationDropdownKey, - hint: new Text( - TranslationBase.of(context).selectAddress, - ), - value: selectedProject, - iconSize: 0, - isExpanded: true, - style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - items: projectsList.map((DriveThroughTestingCenterModel item) { - return new DropdownMenuItem( - value: item, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Text(item.projectName), getCovidTestTypeImage(item)], - ), - ); - }).toList(), - onChanged: (newValue) { - setState(() { - selectedProject = newValue; - setProjectLocation(newValue); - }); - }, + ), + Container( + height: 20, + child: DropdownButtonHideUnderline( + child: DropdownButton( + onTap: () { + print("Clicked"); + }, + key: locationDropdownKey, + hint: new Text( + TranslationBase.of(context).selectAddress, ), + value: selectedProject, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + items: projectsList.map((DriveThroughTestingCenterModel item) { + return new DropdownMenuItem( + value: item, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text(item.projectName), getCovidTestTypeImage(item)], + ), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + selectedProject = newValue; + setProjectLocation(newValue); + }); + }, ), ), - ], - ), + ), + ], ), - Icon(Icons.keyboard_arrow_down), - ], - ), + ), + Icon(Icons.keyboard_arrow_down), + ], ), ), ], diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index dc2e8d78..3780fd08 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -42,37 +42,10 @@ class _DdServicesPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: 'ED Online', + showNewAppBarTitle: true, isShowDecPage: true, isShowAppBar: true, - // appBarTitle: AppBar( - // elevation: 0, - // textTheme: TextTheme( - // headline6: TextStyle( - // color: Theme.of(context).textTheme.headline1.color, - // fontWeight: FontWeight.bold), - // ), - // title: Text( - // 'ED Online', - // style: TextStyle( - // fontWeight: FontWeight.bold, - // color: Theme.of(context).textTheme.headline1.color, - // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), - // // bold: true, - // // color: Colors.white, - // ), - // leading: Builder( - // builder: (BuildContext context) { - // return IconButton( - // icon: Icon(Icons.arrow_back), - // color: Theme.of(context).textTheme.headline1.color, - // onPressed: () { - // showConfirmMessage(context); - // }, - // ); - // }, - // ), - // centerTitle: true, - // ), + showNewAppBar: true, body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, diff --git a/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart b/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart index fd0c8e9a..95ef8026 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart @@ -20,17 +20,15 @@ class EdOnlineNotesPage extends StatefulWidget { final List selectedQuestions; final Function changePageViewIndex; TriageInformationRequest triageInformationRequest; - EdOnlineNotesPage( - {Key key, this.selectedQuestions, this.changePageViewIndex,this.triageInformationRequest}) - ; + + EdOnlineNotesPage({Key key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest}); @override _EdOnlineNotesPageState createState() => _EdOnlineNotesPageState(); } class _EdOnlineNotesPageState extends State { - TextEditingController _chiefComplaintsTextController = - TextEditingController(); + TextEditingController _chiefComplaintsTextController = TextEditingController(); TextEditingController _noteTextController = TextEditingController(); DateTime selectedTime; final _formKey = GlobalKey(); @@ -83,13 +81,11 @@ class _EdOnlineNotesPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, // height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(selectedTime == null ?TranslationBase.of(context).errorExpectedArrivalTime:TranslationBase.of(context).expectedArrivalTime), + Texts(selectedTime == null ? TranslationBase.of(context).errorExpectedArrivalTime : TranslationBase.of(context).expectedArrivalTime), Texts(getDate(context)), ], ), @@ -116,7 +112,7 @@ class _EdOnlineNotesPageState extends State { children: [ Expanded( child: Container( - margin: EdgeInsets.only(left: 5,right: 5), + margin: EdgeInsets.only(left: 5, right: 5), child: SecondaryButton( textColor: Colors.white, color: Theme.of(context).primaryColor, @@ -125,10 +121,12 @@ class _EdOnlineNotesPageState extends State { ), ), ), - SizedBox(width: 10,), + SizedBox( + width: 10, + ), Expanded( child: Container( - margin: EdgeInsets.only(left: 5,right: 5), + margin: EdgeInsets.only(left: 5, right: 5), child: SecondaryButton( textColor: Colors.white, color: Theme.of(context).primaryColor, @@ -137,21 +135,21 @@ class _EdOnlineNotesPageState extends State { onTap: () async { if (_formKey.currentState.validate()) { GifLoaderDialogUtils.showMyDialog(context); - model.saveQuestionsInformation( - chiefComplaint: - _chiefComplaintsTextController.text.toString(), - notes: _noteTextController.text.toString(), - selectedQuestions: widget.selectedQuestions, - projectId: widget.triageInformationRequest.projectID,selectedTime: selectedTime).then((value) { + model + .saveQuestionsInformation( + chiefComplaint: _chiefComplaintsTextController.text.toString(), + notes: _noteTextController.text.toString(), + selectedQuestions: widget.selectedQuestions, + projectId: widget.triageInformationRequest.projectID, + selectedTime: selectedTime) + .then((value) { GifLoaderDialogUtils.hideDialog(context); - if(model.state == ViewState.ErrorLocal) + if (model.state == ViewState.ErrorLocal) AppToast.showErrorToast(message: model.error); - else - { - widget.changePageViewIndex(4); - } - - }).catchError((onError){ + else { + widget.changePageViewIndex(4); + } + }).catchError((onError) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: onError.toString()); }); diff --git a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart index b8498e7c..7f5272b0 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart @@ -1,32 +1,38 @@ import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - -import '../../../Constants.dart'; - +import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class EdOnlineSelectedHospitalPage extends StatefulWidget { final Function changePageViewIndex; TriageInformationRequest triageInformationRequest; - EdOnlineSelectedHospitalPage( - {Key key, this.changePageViewIndex,this.triageInformationRequest}) - : super(key: key); + EdOnlineSelectedHospitalPage({Key key, this.changePageViewIndex, this.triageInformationRequest}) : super(key: key); @override - _EdOnlineSelectedHospitalPageState createState() => - _EdOnlineSelectedHospitalPageState(); + _EdOnlineSelectedHospitalPageState createState() => _EdOnlineSelectedHospitalPageState(); } -class _EdOnlineSelectedHospitalPageState - extends State { +class _EdOnlineSelectedHospitalPageState extends State { + HospitalsModel selectedProject; + final GlobalKey locationDropdownKey = GlobalKey(); + ProjectViewModel projectViewModel; + int _selected = 0; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getHospitals(), builder: (_, model, w) => AppScaffold( @@ -35,67 +41,139 @@ class _EdOnlineSelectedHospitalPageState physics: BouncingScrollPhysics(), child: Column( children: [ - ...List.generate( - model.hospitals.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, + Container( + margin: EdgeInsets.all(12.0), + child: Text(TranslationBase.of(context).onlineCheckInAgreement, style: TextStyle(fontSize: 14.0, color: Colors.black, letterSpacing: -0.56)), + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.all(12.0), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( children: [ - SizedBox( - height: 2, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - widget.triageInformationRequest.selectedHospital = model.hospitals[index]; - widget.triageInformationRequest.projectID = model.hospitals[index].iD; - }); - }, - child: ListTile( - title: Text(model.hospitals[index].name + - ' ${model.hospitals[index].distanceInKilometers} ' + - TranslationBase.of(context).km), - leading: Radio( - value: model.hospitals[index], - groupValue: widget.triageInformationRequest.selectedHospital, - activeColor: secondaryColor, - onChanged: (value) { + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectLocation, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 20, + child: DropdownButtonHideUnderline( + child: DropdownButton( + onTap: () { + print("Clicked"); + }, + key: locationDropdownKey, + hint: new Text( + TranslationBase.of(context).selectHospital, + ), + value: selectedProject, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + items: model.hospitals.map((HospitalsModel item) { + return new DropdownMenuItem( + value: item, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text(item.name + " - " + item.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_)], + ), + ); + }).toList(), + onChanged: (newValue) { setState(() { - widget.triageInformationRequest.selectedHospital = model.hospitals[index]; - widget.triageInformationRequest.projectID = model.hospitals[index].iD; + selectedProject = newValue; + widget.triageInformationRequest.selectedHospital = selectedProject; }); }, ), ), ), - ) - ], + ], + ), ), - SizedBox( - height: 5.0, + Icon(Icons.keyboard_arrow_down), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Radio( + value: 1, + groupValue: _selected, + onChanged: onRadioChanged, + ), + Text( + TranslationBase.of(context).agreeTo, + style: new TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: CustomColors.textColor, + ), + ), + mWidth(4), + InkWell( + onTap: () { + launch("https://hmg.com/en/Pages/Privacy.aspx"); + }, + child: Text( + TranslationBase.of(context).termsConditoins, + style: new TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: CustomColors.accentColor, + ), + ), ), ], ), - ) + ), + DefaultButton( + TranslationBase.of(context).payNow.toUpperCase(), + (){}, + // selectedProcList.length > 0 && getTotalValue() != "0.00" + // ? () { + // makePayment(); + // } + // : null, + color: CustomColors.green, + disabledColor: CustomColors.grey2, + ), ], ), ), - bottomSheet: Container( - height: 76, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: SecondaryButton( - // textColor: Colors.white, - color: Theme.of(context).primaryColor, - label: TranslationBase.of(context).next.toUpperCase(), - disabled: widget.triageInformationRequest.selectedHospital==null, - onTap: () => widget.changePageViewIndex(1)), - ), - ), + // bottomSheet: + // Container( + // height: 76, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: SecondaryButton( + // // textColor: Colors.white, + // color: Theme.of(context).primaryColor, + // label: TranslationBase.of(context).next.toUpperCase(), + // disabled: (widget.triageInformationRequest.selectedHospital == null || _selected == 0), + // onTap: () => widget.changePageViewIndex(1)), + // ), + // ), ), ); } + + void onRadioChanged(int value) { + setState(() { + _selected = value; + }); + } } diff --git a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart index c510196b..0f4e54b2 100644 --- a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart +++ b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart @@ -1,27 +1,42 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class EdPaymentInformationPage extends StatefulWidget { final HospitalsModel selectedHospital; const EdPaymentInformationPage({Key key, this.selectedHospital}) : super(key: key); + @override - _EdPaymentInformationPageState createState() => - _EdPaymentInformationPageState(); + _EdPaymentInformationPageState createState() => _EdPaymentInformationPageState(); } class _EdPaymentInformationPageState extends State { + MyInAppBrowser browser; + ProjectViewModel projectViewModel; + String transID = ""; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatientPaymentInformation(), builder: (_, model, w) => AppScaffold( @@ -31,55 +46,33 @@ class _EdPaymentInformationPageState extends State { child: Column( children: [ Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), - color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white), margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), child: Column( children: [ Container( alignment: Alignment.center, - margin: - EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), - child: Text(TranslationBase.of(context).testFee, - style: TextStyle( - color: Colors.black, - fontSize: 22.0, - fontWeight: FontWeight.bold)), - ), - if(model.erPatientShareModel!=null) - Table( - children: [ - TableRow(children: [ - TableCell( - child: - Texts(TranslationBase.of(context).testFee)), - TableCell( - child: Texts(model - .erPatientShareModel.patientShare - .toStringAsFixed(2))), - ]), - TableRow(children: [ - TableCell( - child: Texts( - TranslationBase.of(context).patientTaxToDo)), - TableCell( - child: Texts(model - .erPatientShareModel.patientTaxAmount - .toStringAsFixed(2))), - ]), - TableRow(children: [ - TableCell( - child: Texts(TranslationBase.of(context) - .patientShareTotalToDo)), - TableCell( - child: Texts(model - .erPatientShareModel.patientShareWithTax - .toStringAsFixed(2))), - ]), - ], + margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), + child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)), ), + if (model.erPatientShareModel != null) + Table( + children: [ + TableRow(children: [ + TableCell(child: Texts(TranslationBase.of(context).testFee)), + TableCell(child: Texts(model.erPatientShareModel.patientShare.toStringAsFixed(2))), + ]), + TableRow(children: [ + TableCell(child: Texts(TranslationBase.of(context).patientTaxToDo)), + TableCell(child: Texts(model.erPatientShareModel.patientTaxAmount.toStringAsFixed(2))), + ]), + TableRow(children: [ + TableCell(child: Texts(TranslationBase.of(context).patientShareTotalToDo)), + TableCell(child: Texts(model.erPatientShareModel.patientShareWithTax.toStringAsFixed(2))), + ]), + ], + ), ], ), ), @@ -94,9 +87,19 @@ class _EdPaymentInformationPageState extends State { color: Theme.of(context).primaryColor, label: TranslationBase.of(context).next.toUpperCase(), onTap: () { - Navigator.push(context, FadePage(page: PaymentMethod())).then( + Navigator.push(context, FadePage(page: PaymentMethod( + onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { + setState(() {}); + }, + ))).then( (value) { //TODO Haroun call API here + print(value); + if (value != null) { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.projectID = widget.selectedHospital.iD; + openPayment(value[0], projectViewModel.user, model.erPatientShareModel.patientShareWithTax, appo); + } }, ); }, @@ -107,6 +110,82 @@ class _EdPaymentInformationPageState extends State { ); } + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); + transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user.patientID); + browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), + authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + service.checkPaymentStatus(transID, AppGlobal.context).then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + ER_createAdvancePayment(res, appo); + } else { + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + ER_createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + service.ER_createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + ER_InsertEROnlinePaymentDetails(res, appo); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + ER_InsertEROnlinePaymentDetails(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + service.ER_InsertEROnlinePaymentDetails(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); + print(err); + }); + } } diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 88b21b11..00424a35 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -9,6 +9,7 @@ import 'package:provider/provider.dart'; import '../../uitl/translations_delegate_base.dart'; import 'AmbulanceReq.dart'; +import 'EdOnline/DdServicesPage.dart'; import 'NearestEr.dart'; class ErOptions extends StatefulWidget { @@ -86,14 +87,14 @@ class _ErOptionsState extends State { ), InkWell( onTap: () { - // Navigator.push(context, FadePage(page: DdServicesPage())); + Navigator.push(context, FadePage(page: DdServicesPage())); }, child: MedicalProfileItem( title: "ED", imagePath: 'assets/images/new-design/AM.PNG', subTitle: TranslationBase.of(context).service, isPngImage: true, - isEnable: false, + isEnable: true, ), ), ], diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 6e817f8c..66102cf4 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; @@ -40,7 +41,7 @@ class PrescriptionItemsPage extends StatelessWidget { baseViewModel: model, showNewAppBar: true, showNewAppBarTitle: true, - body: Column( + body: model.state != ViewState.Busy ? Column( children: [ Expanded( child: SingleChildScrollView( @@ -56,7 +57,7 @@ class PrescriptionItemsPage extends StatelessWidget { "", prescriptions.name, DateUtil.convertStringToDate(prescriptions.appointmentDate), - DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)), + DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.prescriptionReportEnhList[0].orderDate)), prescriptions.nationalityFlagURL, prescriptions.doctorRate, prescriptions.actualDoctorRate, @@ -406,7 +407,7 @@ class PrescriptionItemsPage extends StatelessWidget { ), ), ], - ), + ) : Container(), ), ); } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 7003f376..9c167be4 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -364,7 +364,7 @@ class DoctorsListService extends BaseService { "PatientType": authUser.patientType }; - if(clinicID == 253) { + if (clinicID == 253) { List procedureID = projectViewModel.selectedBodyPartList.map((element) => element.id.toString()).toList(); request["GeneralProcedureList"] = procedureID; request["InitialSlotDuration"] = projectViewModel.laserSelectionDuration; @@ -480,10 +480,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - request = { - "ProjectID": projectID, - "AppointmentNo": appoID - }; + request = {"ProjectID": projectID, "AppointmentNo": appoID}; dynamic localRes; @@ -1378,6 +1375,92 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future ER_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "PatientTypeID": authUser.patientType, + "ERAdvanceAmount": { + "AppointmentID": paymentReference, + "ProjectId": projectID, + "PatientId": authUser.patientID, + "ClinicId": 10, + "DepositorName": authUser.firstName + " " + authUser.lastName, + "MemberId": authUser.patientID, + "NationalityID": authUser.nationalityID, + "PaymentAmount": payedAmount, + "PaymentDate": DateUtil.convertDateToString(DateTime.now()), + "PaymentMethodName": paymentMethodName, + "PaymentReferenceNumber": paymentReference, + "SourceType": 2 + } + }; + dynamic localRes; + await baseAppClient.post(ER_CREATE_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future ER_InsertEROnlinePaymentDetails(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "PatientTypeID": authUser.patientType, + "EROnlineCheckinPaymentDetails": { + "CheckinDate": DateUtil.convertDateToString(DateTime.now()), + "ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()), + "AppointmentID": paymentReference, + "ProjectId": projectID, + "PatientId": authUser.patientID, + "ClinicId": 10, + "FormId": 15, + "DepositorName": authUser.firstName + " " + authUser.lastName, + "MemberId": authUser.patientID, + "NationalityID": authUser.nationalityID, + "PaymentAmount": payedAmount, + "PaymentDate": DateUtil.convertDateToString(DateTime.now()), + "PaymentMethodName": paymentMethodName, + "PaymentReferenceNumber": paymentReference, + "TriageScore": await sharedPref.getInt(ER_CHECKIN_RISK_SCORE) + } + }; + dynamic localRes; + await baseAppClient.post(ER_INSERT_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async { + localRes = response; + sharedPref.remove(ER_CHECKIN_RISK_SCORE); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getPatientHealthDataStats(int medCategoryId, int medCategoryStsId, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index b258a7ff..a21028f8 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -33,13 +33,13 @@ 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/PayFortWeb/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 PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From f9a733884d04c477dfe899933a8d471b31dd8607 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 12 Jun 2022 17:06:59 +0300 Subject: [PATCH 2/4] Calendar fixes --- lib/config/config.dart | 2 +- lib/core/service/client/base_app_client.dart | 4 ++-- lib/uitl/CalendarUtils.dart | 2 +- lib/widgets/in_app_browser/InAppBrowser.dart | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c8a48ef8..b15f49a7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -405,7 +405,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 8.3; +var VERSION_ID = 8.4; var SETUP_ID = '91877'; var LANGUAGE = 2; var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index cc570bd1..a9ed89a6 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -141,11 +141,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - // if (BASE_URL == "https://uat.hmgwebservices.com/") { + if (BASE_URL == "https://uat.hmgwebservices.com/") { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - // } + } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart index ae943617..22c6e959 100644 --- a/lib/uitl/CalendarUtils.dart +++ b/lib/uitl/CalendarUtils.dart @@ -63,7 +63,7 @@ class CalendarUtils { TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime, _currentLocation); print("eventId " + eventId); - Event event = Event(writableCalendars.id, recurrenceRule: recurrenceRule, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description); + Event event = Event(writableCalendars.id, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description); deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { print("catchError " + e.toString()); }).whenComplete(() { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index a21028f8..b258a7ff 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -33,13 +33,13 @@ 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/PayFortWeb/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 PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From 8b7a6e76891e08a95a422054212f46f511c3409e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 14 Jun 2022 13:09:20 +0300 Subject: [PATCH 3/4] ED Online Check-In --- lib/core/service/client/base_app_client.dart | 4 +- lib/main.dart | 5 +- .../new_Home_health_care_step_one_page.dart | 2 - lib/pages/Blood/user_agreement_page.dart | 1 + .../ErService/EdOnline/DdServicesPage.dart | 1 + .../EdOnline/EdOnlineQuestionsPage.dart | 206 ++++++++++++------ .../EdOnlineSelectedHospitalPage.dart | 39 ++-- .../EdOnline/EdPaymentInformationPage.dart | 180 +++++++++------ .../webrtc/signaling.dart | 2 +- .../appointment_services/GetDoctorsList.dart | 2 - lib/splashPage.dart | 1 + lib/uitl/date_uitl.dart | 2 +- lib/uitl/push-notification-handler.dart | 8 +- lib/widgets/in_app_browser/InAppBrowser.dart | 10 +- 14 files changed, 292 insertions(+), 171 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index a9ed89a6..cc570bd1 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -141,11 +141,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (BASE_URL == "https://uat.hmgwebservices.com/") { + // if (BASE_URL == "https://uat.hmgwebservices.com/") { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - } + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/main.dart b/lib/main.dart index 0be89cc5..6840d87d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -57,9 +57,12 @@ class _MyApp extends State { final GlobalKey navigatorKey = GlobalKey(); - Future checkForUpdate() async { // todo need to verify 'imp' + checkForUpdate() { // todo need to verify 'imp' InAppUpdate.checkForUpdate().then((info) { + print("checkForUpdate!!!"); + print(info.toString()); if (info.immediateUpdateAllowed) { + print("Immediate Allowed!!!"); InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); } }).catchError((e) { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index f8e377b7..7984cbbf 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -70,8 +70,6 @@ class _NewHomeHealthCareStepOnePageState extends State { EdOnlineQuestionsPage( changePageViewIndex: _changePageViewIndex, selectedQuestions: selectedQuestions, + selectedHospital: triageInformationRequest.selectedHospital, ), EdOnlineNotesPage( changePageViewIndex: _changePageViewIndex, diff --git a/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart b/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart index e3eb1c4c..c825917a 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart @@ -1,10 +1,13 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/EdOnlineViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,16 +18,13 @@ class EdOnlineQuestionsPage extends StatefulWidget { final Function changePageViewIndex; List selectedQuestions; - EdOnlineQuestionsPage({Key key, this.selectedHospital,this.selectedQuestions, this.changePageViewIndex}); - + EdOnlineQuestionsPage({Key key, this.selectedHospital, this.selectedQuestions, this.changePageViewIndex}); @override _EdOnlineQuestionsPageState createState() => _EdOnlineQuestionsPageState(); } class _EdOnlineQuestionsPageState extends State { - - @override Widget build(BuildContext context) { return BaseView( @@ -37,90 +37,160 @@ class _EdOnlineQuestionsPageState extends State { children: [ ...List.generate( model.triageQuestionsModelList.length, - (index) => - InkWell( - onTap: (){ - setState(() { - if (widget.selectedQuestions - .contains(model.triageQuestionsModelList[index])) { - widget.selectedQuestions - .remove(model.triageQuestionsModelList[index]); - } else { - widget.selectedQuestions - .add(model.triageQuestionsModelList[index]); - } - }); - }, - child: Row( - children: [ - Checkbox( - value: widget.selectedQuestions.contains(model.triageQuestionsModelList[index]), - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() { - if (widget.selectedQuestions - .contains(model.triageQuestionsModelList[index])) { - widget.selectedQuestions - .remove(model.triageQuestionsModelList[index]); - } else { - widget.selectedQuestions - .add(model.triageQuestionsModelList[index]); - } - }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Texts( - model.triageQuestionsModelList[index].question, - fontSize: 15, - ), - ), + (index) => InkWell( + onTap: () { + setState(() { + if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) { + widget.selectedQuestions.remove(model.triageQuestionsModelList[index]); + } else { + widget.selectedQuestions.add(model.triageQuestionsModelList[index]); + } + }); + }, + child: Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Checkbox( + value: widget.selectedQuestions.contains(model.triageQuestionsModelList[index]), + activeColor: Color(0xffD02127), + tristate: false, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + onChanged: (bool newValue) { + setState(() { + if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) { + widget.selectedQuestions.remove(model.triageQuestionsModelList[index]); + } else { + widget.selectedQuestions.add(model.triageQuestionsModelList[index]); + } + }); + }), + SizedBox(width: 6), + Expanded( + child: Text( + model.triageQuestionsModelList[index].question, + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), ), - ], - ), + ), + ], ), - + ), + ), ), - SizedBox(height: 80,) + SizedBox( + height: 120, + ) ], ), ), - bottomSheet: Padding( - padding: const EdgeInsets.all(8.0), + bottomSheet: Container( + color: CustomColors.appBackgroudGreyColor, child: Container( - height: 56, + color: CustomColors.appBackgroudGreyColor, + margin: EdgeInsets.all(14), + height: 45.0, child: Row( - children: [ + mainAxisAlignment: MainAxisAlignment.end, + children: [ Expanded( - child: Container( - margin: EdgeInsets.only(left: 5,right: 5), - child: SecondaryButton( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: new Color(0xffc5272d), textColor: Colors.white, - color: Theme.of(context).primaryColor, - label: TranslationBase.of(context).back.toUpperCase(), - onTap: () => widget.changePageViewIndex(1), + elevation: 0, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + widget.changePageViewIndex(0); + }, + child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 16.0)), ), ), ), - SizedBox(width: 10,), + mWidth(7), Expanded( - child: Container( - margin: EdgeInsets.only(left: 5,right: 5), - child: SecondaryButton( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: CustomColors.green, textColor: Colors.white, - color: Theme.of(context).primaryColor, - label: TranslationBase.of(context).next.toUpperCase(), - disabled: widget.selectedQuestions.isEmpty, - onTap: () => widget.changePageViewIndex(3), + elevation: 0, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: widget.selectedQuestions.isEmpty + ? null + : () { + GifLoaderDialogUtils.showMyDialog(context); + model + .saveQuestionsInformation( + chiefComplaint: "", notes: "", selectedQuestions: widget.selectedQuestions, projectId: widget.selectedHospital.iD, selectedTime: DateTime.now()) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) + AppToast.showErrorToast(message: model.error); + else { + widget.changePageViewIndex(4); + } + }).catchError((onError) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: onError.toString()); + }); + // widget.changePageViewIndex(4); + }, + child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 16.0)), ), ), ), - ], ), ), ), + // Padding( + // padding: const EdgeInsets.all(8.0), + // child: Container( + // height: 56, + // child: Row( + // children: [ + // Expanded( + // child: Container( + // margin: EdgeInsets.only(left: 5, right: 5), + // child: SecondaryButton( + // textColor: Colors.white, + // color: Theme.of(context).primaryColor, + // label: TranslationBase.of(context).back.toUpperCase(), + // onTap: () => widget.changePageViewIndex(1), + // ), + // ), + // ), + // SizedBox( + // width: 10, + // ), + // Expanded( + // child: Container( + // margin: EdgeInsets.only(left: 5, right: 5), + // child: SecondaryButton( + // textColor: Colors.white, + // color: Theme.of(context).primaryColor, + // label: TranslationBase.of(context).next.toUpperCase(), + // disabled: widget.selectedQuestions.isEmpty, + // onTap: () => widget.changePageViewIndex(3), + // ), + // ), + // ), + // ], + // ), + // ), + // ), ), ); } diff --git a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart index 7f5272b0..76eace88 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart @@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -140,33 +139,23 @@ class _EdOnlineSelectedHospitalPageState extends State 0 && getTotalValue() != "0.00" - // ? () { - // makePayment(); - // } - // : null, - color: CustomColors.green, - disabledColor: CustomColors.grey2, - ), ], ), ), - // bottomSheet: - // Container( - // height: 76, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: SecondaryButton( - // // textColor: Colors.white, - // color: Theme.of(context).primaryColor, - // label: TranslationBase.of(context).next.toUpperCase(), - // disabled: (widget.triageInformationRequest.selectedHospital == null || _selected == 0), - // onTap: () => widget.changePageViewIndex(1)), - // ), - // ), + bottomSheet: Container( + color: CustomColors.appBackgroudGreyColor, + padding: EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase.of(context).next, + (widget.triageInformationRequest.selectedHospital == null || _selected == 0) + ? null + : () { + widget.changePageViewIndex(2); + }, + color: CustomColors.green, + disabledColor: CustomColors.grey2, + ), + ), ), ); } diff --git a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart index 0f4e54b2..86236ba2 100644 --- a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart +++ b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart @@ -7,12 +7,13 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -38,7 +39,7 @@ class _EdPaymentInformationPageState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientPaymentInformation(), + onModelReady: (model) async => await model.getPatientPaymentInformation(), builder: (_, model, w) => AppScaffold( baseViewModel: model, body: SingleChildScrollView( @@ -46,75 +47,129 @@ class _EdPaymentInformationPageState extends State { child: Column( children: [ Container( - decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white), - margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), - padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), - child: Column( - children: [ - Container( - alignment: Alignment.center, - margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), - child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)), - ), - if (model.erPatientShareModel != null) - Table( - children: [ - TableRow(children: [ - TableCell(child: Texts(TranslationBase.of(context).testFee)), - TableCell(child: Texts(model.erPatientShareModel.patientShare.toStringAsFixed(2))), - ]), - TableRow(children: [ - TableCell(child: Texts(TranslationBase.of(context).patientTaxToDo)), - TableCell(child: Texts(model.erPatientShareModel.patientTaxAmount.toStringAsFixed(2))), - ]), - TableRow(children: [ - TableCell(child: Texts(TranslationBase.of(context).patientShareTotalToDo)), - TableCell(child: Texts(model.erPatientShareModel.patientShareWithTax.toStringAsFixed(2))), - ]), - ], + decoration: cardRadius(12), + margin: EdgeInsets.fromLTRB(12.0, 30.0, 12.0, 5.0), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).payment, + style: TextStyle( + color: Colors.black, + fontSize: 16.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + )), + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 10, bottom: 3), + child: Row( + children: [ + Expanded( + child: _getNormalText(TranslationBase.of(context).patientShareToDo), + ), + Expanded( + child: _getNormalText(model.erPatientShareModel.patientShare.toStringAsFixed(2) ?? "0", isBold: true), + ) + ], + ), ), - ], + mDivider(Colors.grey[200]), + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 3, bottom: 3), + child: Row( + children: [ + Expanded( + child: _getNormalText(TranslationBase.of(context).patientTaxToDo), + ), + Expanded( + child: _getNormalText(model.erPatientShareModel.patientTaxAmount.toStringAsFixed(2) ?? "0", isBold: true), + ) + ], + ), + ), + mDivider(Colors.grey[200]), + Container( + width: double.infinity, + padding: EdgeInsets.only(top: 3, bottom: 3), + child: Row( + children: [ + Expanded( + child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo), + ), + Expanded( + child: _getNormalText(model.erPatientShareModel.patientShareWithTax.toStringAsFixed(2) ?? "0", isBold: true), + ) + ], + ), + ), + ], + ), + ), + ), + mHeight(50.0), + Text( + TranslationBase.of(context).payOptions, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.46, ), ), + Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), ], ), ), bottomSheet: Container( - height: 76, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: SecondaryButton( - color: Theme.of(context).primaryColor, - label: TranslationBase.of(context).next.toUpperCase(), - onTap: () { - Navigator.push(context, FadePage(page: PaymentMethod( - onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { - setState(() {}); - }, - ))).then( - (value) { - //TODO Haroun call API here - print(value); - if (value != null) { - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - appo.projectID = widget.selectedHospital.iD; - openPayment(value[0], projectViewModel.user, model.erPatientShareModel.patientShareWithTax, appo); - } - }, - ); - }, - ), + color: CustomColors.appBackgroudGreyColor, + padding: EdgeInsets.all(12.0), + child: DefaultButton( + TranslationBase.of(context).payNow.toUpperCase(), + () { + Navigator.push(context, FadePage(page: PaymentMethod( + onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { + setState(() {}); + }, + ))).then( + (value) { + //TODO Haroun call API here + print(value); + if (value != null) { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.projectID = widget.selectedHospital.iD; + openPayment(value[0], projectViewModel.user, model.erPatientShareModel.patientShareWithTax, appo); + } + }, + ); + }, + color: CustomColors.green, + disabledColor: CustomColors.grey2, ), ), ), ); } + _getNormalText(text, {bool isBold = false}) { + return Text( + text, + style: TextStyle( + fontSize: isBold ? 12 : 10, + letterSpacing: -0.5, + color: isBold ? Colors.black : Colors.grey[700], + fontWeight: FontWeight.w600, + ), + ); + } + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user.patientID); - browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), - authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); + browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, + authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); } onBrowserLoadStart(String url) { @@ -163,13 +218,12 @@ class _EdPaymentInformationPageState extends State { }); } - ER_createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + ER_createAdvancePayment(payment_res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - String paymentReference = res['Fort_id'].toString(); GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - service.ER_createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { + service.ER_createAdvancePayment(appo, appo.projectID.toString(), payment_res['Amount'], payment_res['Fort_id'], payment_res['PaymentMethod'], AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - ER_InsertEROnlinePaymentDetails(res, appo); + ER_InsertEROnlinePaymentDetails(payment_res, appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); @@ -177,11 +231,13 @@ class _EdPaymentInformationPageState extends State { }); } - ER_InsertEROnlinePaymentDetails(res, AppoitmentAllHistoryResultList appo) { + ER_InsertEROnlinePaymentDetails(payment_res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - service.ER_InsertEROnlinePaymentDetails(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { + service.ER_InsertEROnlinePaymentDetails(appo, appo.projectID.toString(), payment_res['Amount'], payment_res['Fort_id'], payment_res['PaymentMethod'], AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showSuccessToast(message: TranslationBase.of(context).success); + Navigator.of(context).pop(); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); diff --git a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart index d6e0a071..4ca87644 100644 --- a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart +++ b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart @@ -404,7 +404,7 @@ class Signaling { 'to': session.remote_user?.id, 'from': session.local_user.id, 'candidate': { - 'sdpMLineIndex': candidate.sdpMlineIndex, + 'sdpMLineIndex': candidate.sdpMLineIndex, 'sdpMid': candidate.sdpMid, 'candidate': candidate.candidate, }, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 9c167be4..59924807 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1393,7 +1393,6 @@ class DoctorsListService extends BaseService { "PatientOutSA": authUser.outSA, "PatientTypeID": authUser.patientType, "ERAdvanceAmount": { - "AppointmentID": paymentReference, "ProjectId": projectID, "PatientId": authUser.patientID, "ClinicId": 10, @@ -1436,7 +1435,6 @@ class DoctorsListService extends BaseService { "EROnlineCheckinPaymentDetails": { "CheckinDate": DateUtil.convertDateToString(DateTime.now()), "ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()), - "AppointmentID": paymentReference, "ProjectId": projectID, "PatientId": authUser.patientID, "ClinicId": 10, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index a8a8d029..325acce2 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -44,6 +44,7 @@ class _SplashScreenState extends State { AppSharedPreferences().getAll().then((value){ + debugPrint("ALL SHARED PREFERENCES!!!!!"); debugPrint(jsonEncode(value)); }); } diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 1c9db2f5..dd336844 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -53,7 +53,7 @@ class DateUtil { static String convertDateToString(DateTime date) { const start = "/Date("; - const end = "+0300)"; + const end = "+0300)/"; int milliseconds = date.millisecondsSinceEpoch; return start + "$milliseconds" + end; diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index b448bff4..5fff8ef7 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -271,8 +271,6 @@ class PushNotificationHandler { FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async { print("Firebase onMessageOpenedApp!!!"); - // Utils.showPermissionConsentDialog(context, "onMessageOpenedApp", (){}); - // newMessage(message); if (Platform.isIOS) await Future.delayed(Duration(milliseconds: 3000)).then((value) { newMessage(message); @@ -282,9 +280,15 @@ class PushNotificationHandler { }); FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) { + print("Push Notification onTokenRefresh: " + fcm_token); onToken(fcm_token); }); + FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token){ + print("Push Notification getToken: " + token); + onToken(token); + }); + FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index b258a7ff..e6acc895 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -33,13 +33,13 @@ 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/PayFortWeb/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 PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; @@ -162,7 +162,7 @@ class MyInAppBrowser extends InAppBrowser { applePayInsertRequest.customerEmail = emailId; applePayInsertRequest.customerID = authenticatedUser.patientID; applePayInsertRequest.customerName = authenticatedUser.firstName; - applePayInsertRequest.deviceToken = await sharedPref.getString(PUSH_TOKEN); + applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.doctorID = (doctorID != null && doctorID != "") ? doctorID : 0; applePayInsertRequest.projectID = projId; applePayInsertRequest.serviceID = servID; From 3396b4253b8a6ed4fd40392ed85ad331f8e67d92 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 19 Jun 2022 10:57:52 +0300 Subject: [PATCH 4/4] Updates & fixes --- lib/analytics/flows/appointments.dart | 7 ++ lib/config/config.dart | 4 +- lib/config/localized_values.dart | 3 + lib/core/service/client/base_app_client.dart | 6 +- .../components/DocAvailableAppointments.dart | 4 +- lib/pages/ErService/ErOptions.dart | 4 +- .../MyAppointments/AppointmentDetails.dart | 3 +- .../fragments/home_page_fragment2.dart | 12 ++-- lib/pages/login/confirm-login.dart | 3 +- .../medical/balance/confirm_payment_page.dart | 2 +- .../screens/lacum-activitaion-vida-page.dart | 64 +++++++++---------- lib/uitl/translations_delegate_base.dart | 3 + lib/widgets/in_app_browser/InAppBrowser.dart | 14 ++-- lib/widgets/others/app_scaffold_widget.dart | 3 + pubspec.yaml | 4 +- 15 files changed, 75 insertions(+), 61 deletions(-) diff --git a/lib/analytics/flows/appointments.dart b/lib/analytics/flows/appointments.dart index 50a02c76..720fbb52 100644 --- a/lib/analytics/flows/appointments.dart +++ b/lib/analytics/flows/appointments.dart @@ -264,4 +264,11 @@ class Appointment{ }); } + appointment_cancel(){ + logger('cancel_appointment', parameters: { + 'flow_type' : GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE, + }); + } + + } \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index b15f49a7..02ca3db1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8223bee6..14d8a6cb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1844,4 +1844,7 @@ const Map localizedValues = { "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."}, "liveCarePermissions": {"en": "LiveCare requires Camera & Microphone permissions, 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": "تم تفعيل الحساب بنجاح" }, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index cc570bd1..55684afe 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -142,9 +142,9 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); // if (BASE_URL == "https://uat.hmgwebservices.com/") { - print("URL : $url"); - final jsonBody = json.encode(body); - print(jsonBody); + debugPrint("URL : $url"); + final jsonBody = json.encode(body); + debugPrint(jsonBody); // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 89a2a587..67ef388b 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -81,8 +81,8 @@ class _DocAvailableAppointmentsState extends State wit WidgetsBinding.instance.addPostFrameCallback((_) async { getCurrentLanguage(); - - if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) + bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT); + if (isLiveCareSchedule != null && isLiveCareSchedule) getDoctorScheduledFreeSlots(context, widget.doctor); else { getDoctorFreeSlots(context, widget.doctor); diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 00424a35..40bcc1af 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -87,14 +87,14 @@ class _ErOptionsState extends State { ), InkWell( onTap: () { - Navigator.push(context, FadePage(page: DdServicesPage())); + if (projectViewModel.havePrivilege(81)) Navigator.push(context, FadePage(page: DdServicesPage())); }, child: MedicalProfileItem( title: "ED", imagePath: 'assets/images/new-design/AM.PNG', subTitle: TranslationBase.of(context).service, isPngImage: true, - isEnable: true, + isEnable: projectViewModel.havePrivilege(81), ), ), ], diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index f235c8b1..885013b5 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -614,7 +614,8 @@ class _AppointmentDetailsState extends State with SingleTick } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } - projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); + // projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); + projectViewModel.analytics.appointment.appointment_cancel(); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 1be3f6af..dd12a5cd 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'dart:math' as math; import 'package:auto_size_text/auto_size_text.dart'; @@ -16,7 +15,6 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medic import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; -import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/packages_offers_tab_pager.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -25,9 +23,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; -import 'package:pay/pay.dart'; class HomePageFragment2 extends StatefulWidget { DashboardViewModel model; @@ -104,7 +100,6 @@ class _HomePageFragment2State extends State { onLoginClick: () { widget.onLoginClick(); projectViewModel.analytics.loginRegistration.login_register_initiate(); - // navigateTo(context, CallHomePage()); }, ), // height: MediaQuery.of(context).size.width / 2.6, @@ -242,6 +237,10 @@ class _HomePageFragment2State extends State { ), FlatButton( onPressed: () { + // AppSharedPreferences().getAll().then((value){ + // debugPrint("ALL SHARED PREFERENCES!!!!!"); + // debugPrint(jsonEncode(value)); + // }); Navigator.push(context, FadePage(page: AllHabibMedicalSevicePage2())); projectViewModel.analytics.hmgServices.viewAll(); }, @@ -290,8 +289,7 @@ class _HomePageFragment2State extends State { child: InkWell( onTap: () { AuthenticatedUser user = projectViewModel.user; - if(projectViewModel.havePrivilege(82) || bypassPrivilageCheck) - Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user))); + if (projectViewModel.havePrivilege(82) || bypassPrivilageCheck) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user))); projectViewModel.analytics.offerPackages.log(); }, child: Stack( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 0e79e4c8..80680df8 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -310,7 +310,8 @@ class _ConfirmLogin extends State { login_method = type; LoginRegistration.verificationMethod = type; - projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); + if(!widget.fromRegistration) + projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); switch (type) { case 1: diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 4d3c7718..bf2b2e29 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -209,7 +209,7 @@ class _ConfirmPaymentPageState extends State { child: DefaultButton( TranslationBase.of(context).confirm.toUpperCase(), () { - + // startApplePay(); if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) { openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); } else { diff --git a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart index bcd367ff..ec20d414 100644 --- a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart +++ b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart @@ -2,20 +2,18 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:provider/provider.dart'; -import 'lacum-registration-page.dart'; - class LakumActivationVidaPage extends StatelessWidget { ProjectViewModel projectViewModel; - TextEditingController _identificationNumberController = - new TextEditingController(); + TextEditingController _identificationNumberController = new TextEditingController(); @override Widget build(BuildContext context) { @@ -50,10 +48,7 @@ class LakumActivationVidaPage extends StatelessWidget { padding: const EdgeInsets.all(8.0), child: TextField( controller: _identificationNumberController, - decoration: new InputDecoration( - hintText: TranslationBase.of(context) - .enterIdentificationNumber, - ), + decoration: new InputDecoration(hintText: TranslationBase.of(context).enterIdentificationNumber, focusColor: CustomColors.green), keyboardType: TextInputType.number, style: TextStyle( fontSize: 16, @@ -67,39 +62,38 @@ class LakumActivationVidaPage extends StatelessWidget { margin: EdgeInsets.only(top: 4), child: BorderedButton( TranslationBase.of(context).accountActivation, - backgroundColor: - _identificationNumberController.text != null && - _identificationNumberController.text != "" - ? Color(0xff60686b) - : Color(0xffb0b4b5), + // backgroundColor: _identificationNumberController.text != null && _identificationNumberController.text != "" ? CustomColors.green : Color(0xffb0b4b5), textColor: Colors.white, + backgroundColor: CustomColors.green, + borderColor: CustomColors.green, fontSize: 16, hPadding: 8, vPadding: 12, - handler: _identificationNumberController.text != null || - _identificationNumberController.text != "" + handler: _identificationNumberController.text != null || _identificationNumberController.text != "" ? () { - model - .checkLacumAccountActivation( - _identificationNumberController.text) - .then((_) => { - if (model.state == ViewState.Idle) - { - Navigator.push( - context, - FadePage( - page: LakumRegistrationPage( - _identificationNumberController - .text))) - .then((status) => { - if (status == 200) - {model.makeAccountActivate(projectViewModel.user.patientIdentificationNo)} - // back to previous page - }) - } + model.checkLacumAccountActivation(_identificationNumberController.text).then((_) { + if (model.state == ViewState.Idle) { + if (model.lacumInformation.status != "Hold") { + AppToast.showErrorToast(message: TranslationBase.of(context).lakumUnhold); + if (model.lacumInformation.status != "Discontinue") { + AppToast.showErrorToast(message: TranslationBase.of(context).lakumDiscontinue); + } + } else { + if (model.lacumInformation.status == "Hold") { + model.makeAccountActivate(projectViewModel.user.patientIdentificationNo).then((value) { + AppToast.showSuccessToast(message: TranslationBase.of(context).lakumSuccess); + Navigator.of(context).pop(); }); + } + } + // Navigator.push(context, FadePage(page: LakumRegistrationPage(_identificationNumberController.text))).then((status) => { + // if (status == 200) {model.makeAccountActivate(projectViewModel.user.patientIdentificationNo)} + // // back to previous page + // }) + } + }); } - : () {}, + : null, ), ), ], diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 7b44b24a..d279b564 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2853,6 +2853,9 @@ class TranslationBase { String get termsConditions => localizedValues["termsConditions"][locale.languageCode]; String get liveCarePermissions => localizedValues["liveCarePermissions"][locale.languageCode]; String get prescriptionDeliveryError => localizedValues["prescriptionDeliveryError"][locale.languageCode]; + String get lakumUnhold => localizedValues["lakumUnhold"][locale.languageCode]; + String get lakumDiscontinue => localizedValues["lakumDiscontinue"][locale.languageCode]; + String get lakumSuccess => localizedValues["lakumSuccess"][locale.languageCode]; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e6acc895..7b0b0161 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -20,7 +20,11 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'; enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } var _InAppBrowserOptions = InAppBrowserClassOptions( - inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)), + inAppWebViewGroupOptions: InAppWebViewGroupOptions( + crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true), + ios: IOSInAppWebViewOptions( + applePayAPIEnabled: true, + )), crossPlatform: InAppBrowserOptions(hideUrlBar: true), ios: IOSInAppBrowserOptions( hideToolbarBottom: false, @@ -31,7 +35,7 @@ class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; // 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/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT + 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 @@ -187,8 +191,8 @@ class MyInAppBrowser extends InAppBrowser { service.applePayInsertRequest(applePayInsertRequest, context).then((res) { if (context != null) GifLoaderDialogUtils.hideDialog(context); String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; - safariBrowser.open(url: Uri.parse(url)); - // this.browser.openUrl(url: url, options: _InAppBrowserOptions); + // safariBrowser.open(url: Uri.parse(url)); + this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); }).catchError((err) { print(err); if (context != null) GifLoaderDialogUtils.hideDialog(context); @@ -220,7 +224,7 @@ class MyInAppBrowser extends InAppBrowser { if (order.customValuesXml.contains("ApplePay")) { safariBrowser.open(url: Uri.parse(value)); } else { - this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value))); + this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); } }); } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index a39b9d6a..6865ece5 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:badges/badges.dart'; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; @@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/pr import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.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/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; @@ -404,6 +406,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { else IconButton( onPressed: () { + AppSharedPreferences().remove(IS_LIVECARE_APPOINTMENT); Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (context) => LandingPage()), diff --git a/pubspec.yaml b/pubspec.yaml index 0165c607..0d80cd42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.4.94+404094 +version: 4.4.95+404095 environment: sdk: ">=2.7.0 <3.0.0" @@ -202,7 +202,7 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 - payfort_plugin: ^0.3.1 +# payfort_plugin: ^0.3.1 dependency_overrides: provider : ^5.0.0