From af90ab3aa31b757e39ea07028f0e7c263008dde4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 1 May 2023 14:46:58 +0300 Subject: [PATCH 01/12] Sickleave & chart changes --- lib/config/config.dart | 7 ++++--- lib/pages/medical/patient_sick_leave_page.dart | 16 ++++++++-------- lib/widgets/charts/show_chart.dart | 12 ++++++++---- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- pubspec.yaml | 7 +++++-- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 74d43540..9b5b512e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,9 +20,10 @@ 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -37,7 +38,7 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/mobile/'; +var RC_BASE_URL = 'https://rc.hmg.com/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 1ca32e02..f132741e 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - // isSickLeave: true, - // sickLeaveStatus: model.sickLeaveList[index].status, + isSickLeave: true, + sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - // if (model.sickLeaveList[index].status == 1) { - // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - // } else if (model.sickLeaveList[index].status == 2) { + if (model.sickLeaveList[index].status == 1) { + openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - // } else { - // showApprovalDialog(); - // } + } else { + showApprovalDialog(); + } } void showApprovalDialog() { diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index 49273611..4d69cd84 100644 --- a/lib/widgets/charts/show_chart.dart +++ b/lib/widgets/charts/show_chart.dart @@ -183,9 +183,13 @@ class ShowChart extends StatelessWidget { getMaxX(); getMin(); getMinY(); - increasingY = ((maxY - minY) / timeSeries.length - 1) * 15; - maxY += increasingY.abs(); - minY -= increasingY.abs(); + try { + increasingY = ((maxY - minY) / timeSeries.length - 1) * 15; + maxY += increasingY.abs(); + minY -= increasingY.abs(); + } catch(ex) { + print(ex); + } } double _fetchLeftTileInterval() { @@ -259,7 +263,7 @@ class ShowChart extends StatelessWidget { barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( - show: false, + show: true, ), belowBarData: BarAreaData( show: false, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f62248b8..e91990b4 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index a7222ce6..46d8b2f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.61+1 +version: 4.5.62+1 environment: sdk: ">=2.7.0 <3.0.0" @@ -34,7 +34,7 @@ dependencies: health: ^3.0.3 #chart - fl_chart: ^0.40.2 + fl_chart: ^0.45.0 #Camera Preview camera: ^0.10.1 @@ -172,6 +172,8 @@ dependencies: flutter_nfc_kit: ^3.3.1 + geofencing: ^0.1.0 + # speech_to_text: ^6.1.1 # path: speech_to_text @@ -205,6 +207,7 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 google_api_availability: ^3.0.1 +# flutter_callkit_incoming: ^1.0.3+3 # firebase_core: 1.12.0 dependency_overrides: From 670991eca49c1363597999cb96d702277ff1341d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 2 May 2023 18:06:10 +0300 Subject: [PATCH 02/12] Lab result fix --- lib/pages/login/register.dart | 235 +++++++++--------- .../medical/labs/laboratory_result_page.dart | 17 +- .../data_display/medical/doctor_card.dart | 2 +- 3 files changed, 134 insertions(+), 120 deletions(-) diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index bdb2b623..04b38e67 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; @@ -56,125 +55,127 @@ class _Register extends State { @override Widget build(BuildContext context) { return AppScaffold( - - appBarTitle: TranslationBase.of(context).register, - isShowAppBar: false, - isShowDecPage: false, - showNewAppBar: false, - showNewAppBarTitle: true, - body: Column( - children: [ - Expanded( - child: ListView( - padding: EdgeInsets.all(21), - physics: BouncingScrollPhysics(), - children: [ - SizedBox(height: 10), - Padding( - padding: EdgeInsets.all(10), - child: Text( - TranslationBase.of(context).enterNationalId, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), - )), - SizedBox(height: 10), - PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - SizedBox(height: 12), - Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), - SizedBox(height: 20), - Row( - children: [ - Expanded( - child: Row( - children: [ - Radio( - value: 1, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).hijriDate), - ], - ), + appBarTitle: TranslationBase.of(context).register, + isShowAppBar: false, + isShowDecPage: false, + showNewAppBar: false, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + children: [ + SizedBox(height: 10), + Padding( + padding: EdgeInsets.all(10), + child: Text( + TranslationBase.of(context).enterNationalId, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + )), + SizedBox(height: 10), + PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), + SizedBox(height: 12), + Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), + SizedBox(height: 20), + Row( + children: [ + Expanded( + child: Row( + children: [ + Radio( + value: 1, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).hijriDate), + ], ), - Expanded( - child: Row( - children: [ - Radio( - value: 0, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).gregorianDate), - ], - ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 0, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).gregorianDate), + ], ), - ], - ), - Row(children: [ - Container( - width: SizeConfig.realScreenWidth * .9, - child: isHijri == 1 - ? Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, - isNumber: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - ))) - : Container( - child: InkWell( - onTap: () { - if (isHijri != null) _selectDate(context); - }, - child: Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, - isNumber: false, - isEnable: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - )))))), - ]) - ], - ), + ), + ], + ), + Row(children: [ + Container( + width: SizeConfig.realScreenWidth * .9, + child: isHijri == 1 + ? Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, + isNumber: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + ))) + : Container( + child: InkWell( + onTap: () { + if (isHijri != null) _selectDate(context); + }, + child: Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, + isNumber: false, + isEnable: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + )))))), + ]) + ], ), - Container( - width: double.maxFinite, - // height: 80.0, - color: Colors.white, - // margin: EdgeInsets.only(bottom: 50.0), - child: Row( - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () { - Navigator.of(context).pop(); - locator().loginRegistration.registration_cancel(step: 'enter details'); - }, textColor: Colors.white, color: Color(0xffD02127))), - ), - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).next, (){ - startRegistration(); - locator().loginRegistration.registration_enter_details(); - }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), - ), - ], - ),) - ], - ),); + ), + Container( + width: double.maxFinite, + // height: 80.0, + color: Colors.white, + // margin: EdgeInsets.only(bottom: 50.0), + child: Row( + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).cancel, () { + Navigator.of(context).pop(); + locator().loginRegistration.registration_cancel(step: 'enter details'); + }, textColor: Colors.white, color: Color(0xffD02127))), + ), + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).next, () { + startRegistration(); + locator().loginRegistration.registration_enter_details(); + }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), + ), + ], + ), + ) + ], + ), + ); } Future _selectDate(BuildContext context) async { diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 4bd29c19..847f979b 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -47,13 +47,26 @@ class _LaboratoryResultPageState extends State { GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, + // details: model.patientLabSpecialResult[index].resultDataHTML, + details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), orderNo: widget.patientLabOrders.orderNo, patientLabOrder: widget.patientLabOrders, ), - itemCount: model.patientLabSpecialResult.length, + itemCount: 1, ), ), ); } + + String getSpecialResults(LabsViewModel model) { + String labResults = ""; + model.patientLabSpecialResult.forEach((element) { + if (element.resultDataHTML != null) { + labResults += (element.resultDataHTML + "

"); + } else { + labResults += ("
No Result Available
"); + } + }); + return labResults; + } } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index d58dccf3..f06d508a 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -224,7 +224,7 @@ class DoctorCard extends StatelessWidget { onTap: onEmailTap, child: Icon( Icons.email, - color: Theme.of(context).primaryColor, + color: sickLeaveStatus != 3 ? Theme.of(context).primaryColor : Colors.grey[400], ), ) : onTap != null From 701eedf147363929368aba57229380fb66fa90c9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 9 May 2023 09:58:00 +0300 Subject: [PATCH 03/12] updates --- lib/config/localized_values.dart | 6 +++--- lib/pages/login/register-info.dart | 9 ++++++--- lib/pages/login/register_new_dubai.dart | 0 lib/widgets/new_design/doctor_header.dart | 10 +++++----- 4 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 lib/pages/login/register_new_dubai.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea622e49..1c02644e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -208,7 +208,7 @@ const Map localizedValues = { "last-name": {"en": "Last Name", "ar": "إسم العائلة"}, "female": {"en": "Female", "ar": "أنثى"}, "male": {"en": "Male", "ar": "ذكر"}, - "preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"}, + "preferred-language": {"en": "Preferred Language *", "ar": "اللغة المفضلة *"}, "english": {"en": "English", "ar": "الإنجليزية"}, "arabic": {"en": "Arabic", "ar": "العربية"}, "locations-register": {"en": "Where do you want to create this file?", "ar": "أين تريد فتح هذا الملف؟"}, @@ -682,7 +682,7 @@ const Map localizedValues = { "ar": "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي) ..." }, - "email": {"en": "Email", "ar": "البريد الالكتروني"}, + "email": {"en": "Email *", "ar": "البريد الالكتروني *"}, "Book": {"en": "Book", "ar": "حجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, @@ -1324,7 +1324,7 @@ const Map localizedValues = { "notif-permission-title": {"en": "Could not set the water reminders", "ar": "لا يمكن ضبط اشعار شرب الماء"}, "notif-permission-msg": {"en": "To recieve water reminders, please turn on notifications in the system settings", "ar": "الرجاء تفعيل الاشعارات في الاعدادات"}, "verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"}, - "select-location": {"en": "Select Location", "ar": "اختر الموقع"}, + "select-location": {"en": "Select Location *", "ar": "اختر الموقع *"}, "result-header": {"en": "Get the result in Few Hours", "ar": "احصل على النتيجة خلال عدة ساعات"}, "please_select_gender": {"en": "Please select gender", "ar": "يرجى تحديد الجنس"}, "covid-info": { diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 5d7db69f..53d113e3 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -26,7 +26,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; @@ -278,7 +277,7 @@ class _RegisterInfo extends State { Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).cancel, () { + child: DefaultButton(page == 2 ? TranslationBase.of(context).back : TranslationBase.of(context).cancel, () { Navigator.of(context).pop(); locator().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details'); }, textColor: Colors.white, color: Color(0xffD02127))), @@ -287,7 +286,11 @@ class _RegisterInfo extends State { child: Padding( padding: EdgeInsets.all(10), child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { - nextPage(); + if (isValid() && page == 2 || page == 1) { + nextPage(); + } else { + Utils.showErrorToast(TranslationBase.of(context).validEmail); + } page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); }, textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)), ), diff --git a/lib/pages/login/register_new_dubai.dart b/lib/pages/login/register_new_dubai.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 2c9bb42a..806cbb4a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -302,7 +302,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -323,7 +323,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -344,7 +344,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -365,7 +365,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -387,7 +387,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), From c48f393f95ac7dd574487005a4f3cd8fb6bd3c56 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 9 May 2023 10:33:49 +0300 Subject: [PATCH 04/12] Dubai registration fixed --- lib/config/config.dart | 6 +- lib/config/shared_pref_kay.dart | 1 + lib/core/viewModels/project_view_model.dart | 8 +- .../check_paitent_authentication_req.dart | 16 +- lib/models/Authentication/countries_list.dart | 21 + lib/pages/login/confirm-login.dart | 19 +- lib/pages/login/register-info.dart | 1095 ++++++++++++----- lib/pages/login/register.dart | 9 +- .../authentication/auth_provider.dart | 14 +- .../clinic_services/get_clinic_service.dart | 10 + 10 files changed, 882 insertions(+), 317 deletions(-) create mode 100644 lib/models/Authentication/countries_list.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 9b5b512e..96c71d2c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -19,9 +19,9 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; 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 = 'http://10.50.100.198:2018/'; var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +//var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -591,6 +591,8 @@ var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCar var INSERT_FREE_SLOTS_LOGS = 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs'; +var GET_NATIONALITY ='Services/Lists.svc/REST/GetNationality'; + class AppGlobal { static var context; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 9e5c4f27..ec82db11 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -42,3 +42,4 @@ const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL'; const CLINICS_LIST = 'CLINICS_LIST'; const COVID_QA_LIST = 'COVID_QA_LIST'; const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN'; +const REGISTER_INFO_DUBAI ='register-info-dubai'; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index a536d527..c45e7dd8 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; +import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; @@ -38,9 +39,10 @@ class ProjectViewModel extends BaseViewModel { double _latitude; double _longitude; + RegisterInfoResponse _registerInfo =RegisterInfoResponse(); double get latitude => _latitude; double get longitude => _longitude; - + RegisterInfoResponse get registerInfo=> _registerInfo; dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; @@ -164,4 +166,8 @@ class ProjectViewModel extends BaseViewModel { searchvalue = data; notifyListeners(); } + setRegisterData(RegisterInfoResponse data){ + _registerInfo =data; + notifyListeners(); + } } diff --git a/lib/models/Authentication/check_paitent_authentication_req.dart b/lib/models/Authentication/check_paitent_authentication_req.dart index 2846c1fc..76493f87 100644 --- a/lib/models/Authentication/check_paitent_authentication_req.dart +++ b/lib/models/Authentication/check_paitent_authentication_req.dart @@ -15,7 +15,9 @@ class CheckPatientAuthenticationReq { Null sessionID; bool isDentalAllowedBackend; int deviceTypeID; - + String dob; + int isHijri; + String healthId; CheckPatientAuthenticationReq( {this.patientMobileNumber, this.zipCode, @@ -32,7 +34,11 @@ class CheckPatientAuthenticationReq { this.patientOutSA, this.sessionID, this.isDentalAllowedBackend, - this.deviceTypeID}); + this.deviceTypeID, + this.dob, + this.isHijri, + this.healthId + }); CheckPatientAuthenticationReq.fromJson(Map json) { patientMobileNumber = json['PatientMobileNumber']; @@ -51,6 +57,9 @@ class CheckPatientAuthenticationReq { sessionID = json['SessionID']; isDentalAllowedBackend = json['isDentalAllowedBackend']; deviceTypeID = json['DeviceTypeID']; + dob = json['dob']; + isHijri = json['isHijri']; + healthId = json['HealthId']; } Map toJson() { @@ -71,6 +80,9 @@ class CheckPatientAuthenticationReq { data['SessionID'] = this.sessionID; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['DeviceTypeID'] = this.deviceTypeID; + data['dob'] =this.dob; + data['isHijri'] = this.isHijri; + data['HealthId'] = healthId; return data; } } diff --git a/lib/models/Authentication/countries_list.dart b/lib/models/Authentication/countries_list.dart new file mode 100644 index 00000000..3c314da9 --- /dev/null +++ b/lib/models/Authentication/countries_list.dart @@ -0,0 +1,21 @@ +class CountriesLists { + String iD; + String name; + dynamic nameN; + + CountriesLists({this.iD, this.name, this.nameN}); + + CountriesLists.fromJson(Map json) { + iD = json['ID']; + name = json['Name']; + nameN = json['NameN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Name'] = this.name; + data['NameN'] = this.nameN; + return data; + } +} \ No newline at end of file diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 1fd3bbda..73012bd5 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -42,8 +42,8 @@ import 'package:provider/provider.dart'; class ConfirmLogin extends StatefulWidget { final Function changePageViewIndex; final fromRegistration; - - const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false}) : super(key: key); + final bool isDubai; + const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key); @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -385,8 +385,10 @@ class _ConfirmLogin extends State { var request = this.getCommonRequest(type: type); request.sMSSignature = await SMSOTP.getSignature(); GifLoaderDialogUtils.showMyDialog(context); - if (healthId != null) { - request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + if (healthId != null || widget.isDubai) { + if(!widget.isDubai){ + request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + } request.healthId = healthId; request.isHijri = isHijri; await this.authService.sendActivationCodeRegister(request).then((result) { @@ -547,7 +549,7 @@ class _ConfirmLogin extends State { request.searchType = this.registerd_data.searchType != null ? this.registerd_data.searchType : 1; request.patientID = this.registerd_data.patientID != null ? this.registerd_data.patientID : 0; request.patientIdentificationID = request.nationalID = this.registerd_data.patientIdentificationID != null ? this.registerd_data.patientIdentificationID : '0'; - + request.dob = this.registerd_data.dob; request.isRegister = this.registerd_data.isRegister; } else { request.searchType = request.searchType != null ? request.searchType : 2; @@ -565,8 +567,10 @@ class _ConfirmLogin extends State { GifLoaderDialogUtils.showMyDialog(context); var request = this.getCommonRequest().toJson(); dynamic res; - if (healthId != null) { - request['DOB'] = dob; + if (healthId != null || widget.isDubai) { + if(!widget.isDubai) { + request['DOB'] = dob; + } request['HealthId'] = healthId; request['IsHijri'] = isHijri; @@ -579,6 +583,7 @@ class _ConfirmLogin extends State { result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) { + // if(widget.isDubai ==false){ widget.changePageViewIndex(1), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), } diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 5d7db69f..716c2006 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -6,8 +6,10 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as checkActivation; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' + as checkActivation; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; @@ -36,7 +38,8 @@ class RegisterInfo extends StatefulWidget { final Function changePageViewIndex; final int page; - const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) : super(key: key); + const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) + : super(key: key); @override _RegisterInfo createState() => _RegisterInfo(); @@ -45,7 +48,7 @@ class RegisterInfo extends StatefulWidget { class _RegisterInfo extends State { final authService = new AuthProvider(); final sharedPref = new AppSharedPreferences(); - RegisterInfoResponse registerInfo; + RegisterInfoResponse registerInfo =RegisterInfoResponse(); bool isLoading; int page; final List locationList = [ @@ -53,31 +56,49 @@ class _RegisterInfo extends State { new Location(name: 'Dubai', value: '2'), ]; String language = '1'; - var registerd_data; + CheckPatientAuthenticationReq registerd_data; final List languageList = [ new Language(name: 'English', value: '2'), new Language(name: 'Arabic', value: '1'), ]; + final List genderList = [ + new Language(name: 'Male', value: 'M'), + new Language(name: 'Female', value: 'F'), + ]; + final List maritalList = [ + new Language(name: 'Married', value: 'M'), + new Language(name: 'Single', value: 'S'), + new Language(name: 'Divorce', value: 'D'), + ]; String email = ''; - + List countriesList = []; ToDoCountProviderModel toDoProvider; String location = '1'; - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); ProjectViewModel projectViewModel; - AppointmentRateViewModel appointmentRateViewModel = locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); + bool isDubai =false; + RegisterInfoResponse data = RegisterInfoResponse(); + CheckPatientAuthenticationReq data2; + String gender = 'M'; + String maritalStatus = 'M'; + String nationality = 'SAU'; @override void initState() { - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getRegisterInfo(); - }); - setState(() { - page = widget.page; - }); - super.initState(); + if(widget.page ==1) { + getCountries(); + } + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getRegisterInfo(); + }); + page = widget.page; + super.initState(); } @override @@ -85,17 +106,23 @@ class _RegisterInfo extends State { projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); return AppScaffold( - appBarTitle: TranslationBase.of(context).register, + appBarTitle: TranslationBase + .of(context) + .register, isShowAppBar: false, isShowDecPage: false, body: SingleChildScrollView( padding: EdgeInsets.all(30), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: < + Widget>[ Row( children: [ Expanded( child: AppText( - TranslationBase.of(context).personalInfo, + TranslationBase + .of(context) + .personalInfo, fontSize: 16, textAlign: TextAlign.left, fontWeight: FontWeight.bold, @@ -105,169 +132,385 @@ class _RegisterInfo extends State { ], ), SizedBox(height: 20), - registerInfo != null && page == 1 + (isDubai && page == 1) + ? Column( + children: [ + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .identificationNumber, + registerd_data.patientIdentificationID, + TranslationBase + .of(context) + .mobileNumber, + registerd_data.patientMobileNumber.toString()), + // SizedBox(height: 20), + getnameField( + '', + + + inputWidget( TranslationBase + .of(context) + .firstName, TranslationBase + .of(context) + .firstName,'fName'), + '', + inputWidget( TranslationBase + .of(context) + .middleName, TranslationBase + .of(context) + .middleName,'sName'), + ), + + getnameField( + '', + inputWidget( TranslationBase + .of(context) + .lastName, TranslationBase + .of(context) + .lastName, 'lName'), + + TranslationBase + .of(context) + .gender, + Container( + height: 20, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: gender, + hint: Text(TranslationBase + .of(context) + .gender), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + gender = value; + registerInfo.gender = value; + }) + }, + items: genderList + .map>( + (Language value) { + return DropdownMenuItem( + value: value.value, + child: Text(value.name), + ); + }).toList()))), + ), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .maritalStatus, + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: maritalStatus, + hint: Text(TranslationBase + .of(context) + .maritalStatus), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + maritalStatus = value; + registerInfo.maritalStatusCode = value; + }) + }, + items: maritalList + .map>( + (Language value) { + return DropdownMenuItem( + value: value.value, + child: Text(value.name), + ); + }).toList()))), + TranslationBase + .of(context) + .nationality, + Container( + height: 22, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: nationality, + hint: Text(TranslationBase + .of(context) + .nationality), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + nationality = value; + registerInfo.nationalityCode = value; + }) + }, + items: countriesList + .map>( + (CountriesLists value) { + return DropdownMenuItem( + value: value.iD, + child: Text(value.name), + ); + }).toList())))), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .dateOfBirth, + registerd_data.dob, + "", ""), + SizedBox(height: 20), + ], + ) + : (registerInfo.healthId != null && page == 1) + ? Column( + children: [ + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .identificationNumber, + registerInfo.idNumber, + TranslationBase + .of(context) + .firstName, + registerInfo.firstNameEn == '-' + ? registerInfo.firstNameAr + : registerInfo.firstNameEn), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .middleName, + registerInfo.secondNameEn == '-' + ? registerInfo.secondNameEn + : registerInfo.secondNameEn, + TranslationBase + .of(context) + .lastName, + registerInfo.lastNameEn == '-' + ? registerInfo.lastNameEn + : registerInfo.lastNameEn), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .gender, + registerInfo.maritalStatusCode == 'U' + ? 'Unknown' + : registerInfo.maritalStatusCode == 'M' + ? 'Male' + : 'Female', + TranslationBase + .of(context) + .maritalStatus, + registerInfo.maritalStatus), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .nationality, + registerInfo.nationality, + TranslationBase + .of(context) + .mobileNumber, + registerd_data.patientMobileNumber.toString()), + SizedBox(height: 20), + getnameField(TranslationBase + .of(context) + .dateOfBirth, + registerInfo.dateOfBirth, "", ""), + SizedBox(height: 20), + ], + ) + : widget.page == 2 ? Column( - children: [ - SizedBox(height: 20), - getnameField(TranslationBase.of(context).identificationNumber, registerInfo.idNumber, TranslationBase.of(context).firstName, - registerInfo.firstNameEn == '-' ? registerInfo.firstNameAr : registerInfo.firstNameEn), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).middleName, registerInfo.secondNameEn == '-' ? registerInfo.secondNameEn : registerInfo.secondNameEn, - TranslationBase.of(context).lastName, registerInfo.lastNameEn == '-' ? registerInfo.lastNameEn : registerInfo.lastNameEn), - SizedBox(height: 20), - getnameField( - TranslationBase.of(context).gender, - registerInfo.maritalStatusCode == 'U' - ? 'Unknown' - : registerInfo.maritalStatusCode == 'M' - ? 'Male' - : 'Female', - TranslationBase.of(context).maritalStatus, - registerInfo.maritalStatus), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).nationality, registerInfo.nationality, TranslationBase.of(context).mobileNumber, registerd_data.patientMobileNumber.toString()), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).dateOfBirth, registerInfo.dateOfBirth, "", ""), - SizedBox(height: 20), - ], - ) - : registerInfo != null && widget.page == 2 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).prefferedLanguage, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only( + left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + TranslationBase + .of(context) + .prefferedLanguage, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: language, - hint: Text(TranslationBase.of(context).prefferedLanguage), - iconSize: 40, - elevation: 16, - onChanged: (value) => { - setState(() { - language = value; - }) - }, - items: languageList.map>((Language value) { - return DropdownMenuItem( - value: value.value, - child: Text(value.name), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), - 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: 18, + child: + DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: language, + hint: Text(TranslationBase + .of(context) + .prefferedLanguage), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + language = + value; + }) + }, + items: languageList.map< + DropdownMenuItem< + String>>( + (Language value) { + return DropdownMenuItem< + String>( + value: + value.value, + child: Text( + value.name), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only( + left: 10, right: 10, top: 5, bottom: 25), + 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: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: location, - hint: Text(TranslationBase.of(context).selectLocation), - iconSize: 40, - elevation: 16, - onChanged: (value) => { - setState(() { - location = value; - }) - }, - items: locationList.map>((Location value) { - return DropdownMenuItem( - value: value.value, - child: Text( - value.name, - ), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 12), - margin: EdgeInsets.only(bottom: 0), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).email, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), + ), + Container( + height: 18, + child: + DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: location, + hint: Text( + TranslationBase + .of( + context) + .selectLocation), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + location = + value; + }) + }, + items: locationList.map< + DropdownMenuItem< + String>>( + (Location value) { + return DropdownMenuItem< + String>( + value: + value.value, + child: Text( + value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only( + left: 10, right: 10, top: 5, bottom: 12), + margin: EdgeInsets.only(bottom: 0), + child: Row(children: [ + Flexible( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + TranslationBase + .of(context) + .email, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, ), - Container( - child: TextField( - onChanged: (value) { - setState(() { - email = value; - }); - }, - style: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff2B353E), - letterSpacing: -0.44, - ), - decoration: InputDecoration( - isDense: true, - hintStyle: TextStyle( + ), + Container( + child: TextField( + onChanged: (value) { + setState(() { + email = value; + }); + }, + style: TextStyle( fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w400, - color: Color(0xff575757), - letterSpacing: -0.56, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: + BoxConstraints(minWidth: 50), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, ), - prefixIconConstraints: BoxConstraints(minWidth: 50), - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - ), - )) - ])) - ])), - ], - ) - : SizedBox(), + )) + ])) + ])), + ], + ) + : SizedBox(), ]), ), bottomSheet: Container( @@ -278,89 +521,148 @@ class _RegisterInfo extends State { Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).cancel, () { + child: + DefaultButton(TranslationBase + .of(context) + .cancel, () { Navigator.of(context).pop(); - locator().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details'); + locator() + .loginRegistration + .registration_cancel( + step: page == 1 + ? 'personal info' + : 'other details'); }, textColor: Colors.white, color: Color(0xffD02127))), ), Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { + child: DefaultButton( + page == 1 + ? TranslationBase + .of(context) + .next + : TranslationBase + .of(context) + .register, () { nextPage(); - page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); - }, textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)), + page == 1 + ? locator() + .loginRegistration + .registration_personal_info() + : locator() + .loginRegistration + .registration_patient_info(); + }, + textColor: Colors.white, + color: isValid() == true + ? Color(0xff359846) + : Colors.grey)), ), ], ))); } - nextPage() { + nextPage() async{ if (page == 1) { - setState(() { + if(isDubai) { + await setRegisterData(); widget.changePageViewIndex(2); - }); + } + else{ + widget.changePageViewIndex(2); + } } else { registerNow(); } } + setRegisterData() async{ + registerInfo.gender = gender; + registerInfo.maritalStatusCode =maritalStatus; + registerInfo.nationalityCode =nationality; + projectViewModel.setRegisterData(registerInfo); + // await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo); + } registerNow() { - dynamic request = getTempUserRequest(); - GifLoaderDialogUtils.showMyDialog(context); + dynamic request; + if(isDubai) + request = getTempUserRequestDubai(); + else + request = getTempUserRequest(); + + GifLoaderDialogUtils.showMyDialog(context); dynamic res; this .authService .registerUser(request) - .then((result) => { - GifLoaderDialogUtils.hideDialog(context), - if (result is String) - { - new ConfirmDialog( - context: context, - confirmMessage: result, - okText: TranslationBase.of(context).ok, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, - cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}).showAlertDialog(context) - } - else - { - res = result, - result = checkActivation.CheckActivationCode.fromJson(result), - // result.list.isFamily = false, - // sharedPref.setObject(USER_PROFILE, result.list), - // this.sharedPref.setObject(MAIN_USER, result.list), - // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - // sharedPref.setString(TOKEN, result.authenticationTokenID), - // this.setUser(result), - sharedPref.remove(FAMILY_FILE), - result.list.isFamily = false, - - sharedPref.setString(BLOOD_TYPE, result.patientBloodType), - authenticatedUserObject.user = result.list, - projectViewModel.setPrivilege(privilegeList: res), - sharedPref.setObject(MAIN_USER, result.list), - sharedPref.setObject(USER_PROFILE, result.list), - - sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - sharedPref.setString(TOKEN, result.authenticationTokenID), - AppToast.showSuccessToast(message: TranslationBase.of(context).successRegister), - checkIfUserAgreedBefore(result), - projectViewModel.analytics.loginRegistration.registration_confirmation() - } - }) + .then((result) => + { + GifLoaderDialogUtils.hideDialog(context), + if (result is String) + { + new ConfirmDialog( + context: context, + confirmMessage: result, + okText: TranslationBase + .of(context) + .ok, + cancelText: TranslationBase + .of(context) + .cancel_nocaps, + okFunction: () => + {ConfirmDialog.closeAlertDialog(context)}, + cancelFunction: () => + { + ConfirmDialog.closeAlertDialog(context) + }).showAlertDialog(context) + } + else + { + res = result, + result = checkActivation.CheckActivationCode.fromJson(result), + // result.list.isFamily = false, + // sharedPref.setObject(USER_PROFILE, result.list), + // this.sharedPref.setObject(MAIN_USER, result.list), + // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + // sharedPref.setString(TOKEN, result.authenticationTokenID), + // this.setUser(result), + sharedPref.remove(FAMILY_FILE), + result.list.isFamily = false, + + sharedPref.setString(BLOOD_TYPE, result.patientBloodType), + authenticatedUserObject.user = result.list, + projectViewModel.setPrivilege(privilegeList: res), + sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(USER_PROFILE, result.list), + + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + AppToast.showSuccessToast( + message: TranslationBase + .of(context) + .successRegister), + checkIfUserAgreedBefore(result), + projectViewModel.analytics.loginRegistration + .registration_confirmation() + } + }) .catchError((err) { // GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: err, - okText: TranslationBase.of(context).confirm, - cancelText: TranslationBase.of(context).cancel_nocaps, + okText: TranslationBase + .of(context) + .confirm, + cancelText: TranslationBase + .of(context) + .cancel_nocaps, okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - projectViewModel.analytics.loginRegistration.registration_fail(errorType: err); + projectViewModel.analytics.loginRegistration + .registration_fail(errorType: err); }); } @@ -374,30 +676,44 @@ class _RegisterInfo extends State { } getRegisterInfo() async { - var data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + + if (await sharedPref.getObject(NHIC_DATA) != null) { + data = + RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + this.registerInfo = data; + } if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { - var data2 = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + data2 = CheckPatientAuthenticationReq.fromJson( + await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); setState(() { - this.registerInfo = data; + this.registerd_data = data2; + isDubai = data2.patientOutSA == 1 ? true : false; }); } } getTempUserRequest() { + + DateFormat dateFormat = DateFormat("mm/dd/yyyy"); print(dateFormat.parse(registerInfo.dateOfBirth)); - var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); + var hDate = + new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); var date = hDate.toString(); return { "Patientobject": { "TempValue": true, - "PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationType": + registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationNo": registerInfo.idNumber, "MobileNumber": registerd_data.patientMobileNumber, - "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, + "PatientOutSA": (registerd_data.zipCode == '966' || + registerd_data.zipCode == '+966') + ? 0 + : 1, "FirstNameN": registerInfo.firstNameAr, "FirstName": registerInfo.firstNameEn, "MiddleNameN": registerInfo.secondNameAr, @@ -405,8 +721,9 @@ class _RegisterInfo extends State { "LastNameN": registerInfo.lastNameAr, "LastName": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, - "DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth.replaceAll('/', '-')), - "Gender": registerInfo.gender == 'M' ? 1 : 2, + "DateofBirth": DateUtil.convertISODateToJsonDate( + registerInfo.dateOfBirth.replaceAll('/', '-')), + "Gender": registerInfo.gender== 'M' ? 1 : 2, "NationalityID": registerInfo.nationalityCode, "eHealthIDField": registerInfo.healthId, "DateofBirthN": date, @@ -416,16 +733,76 @@ class _RegisterInfo extends State { "Marital": registerInfo.maritalStatusCode == 'U' ? '0' : registerInfo.maritalStatusCode == 'M' - ? '1' - : '2', + ? '1' + : '2', }, "PatientIdentificationID": registerInfo.idNumber, - "PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(), + "PatientMobileNumber": + registerd_data.patientMobileNumber.toString()[0] == '0' + ? registerd_data.patientMobileNumber + : '0' + registerd_data.patientMobileNumber.toString(), + }; + } + + + getTempUserRequestDubai(){ + DateFormat dateFormat = DateFormat("mm/dd/yyyy"); + registerInfo= projectViewModel.registerInfo; + print(dateFormat.parse(registerd_data.dob)); + var hDate = + new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); + var date = hDate.toString(); + final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy'); + final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); + + return { + "Patientobject": { + "TempValue": true, + "PatientIdentificationType": + registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationNo": registerd_data.patientIdentificationID, + "MobileNumber": registerd_data.patientMobileNumber, + "PatientOutSA": (registerd_data.zipCode == '966' || + registerd_data.zipCode == '+966') + ? 0 + : 1, + "FirstNameN": registerInfo.firstNameAr ??"", + "FirstName": registerInfo.firstNameEn??"", + "MiddleNameN": registerInfo.secondNameAr?? "", + "MiddleName": registerInfo.secondNameEn ??"", + "LastNameN": registerInfo.lastNameAr ??"", + "LastName":registerInfo.lastNameEn ??"", + "StrDateofBirth": dateFormat1.format( + dateFormat2.parse(registerd_data.dob)), + "DateofBirth": DateUtil.convertISODateToJsonDate( + registerd_data.dob.replaceAll('/', '-')), + "Gender": registerInfo.gender== 'M' ? 1 : 2, + "NationalityID": registerInfo.nationalityCode, + "eHealthIDField":null, + "DateofBirthN": date, + "EmailAddress": email, + "SourceType": location, + "PreferredLanguage": registerd_data.languageID.toString(), + "Marital": registerInfo.maritalStatusCode == 'U' + ? '0' + : registerInfo.maritalStatusCode == 'M' + ? '1' + : '2', + }, + "PatientIdentificationID": registerd_data.patientIdentificationID, + "PatientMobileNumber": + registerd_data.patientMobileNumber.toString()[0] == '0' + ? registerd_data.patientMobileNumber + : '0' + registerd_data.patientMobileNumber.toString(), + "DOB":registerd_data.dob, + "IsHijri":registerd_data.isHijri }; } bool isValid() { - if (location != null && language != null && Utils.validEmail(email) == true) { + if ((location != null && + language != null && + Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null)) { return true; } else { return false; @@ -436,49 +813,57 @@ class _RegisterInfo extends State { return Row( children: [ Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - name1, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.44, - ), - ), - Text( - value1, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ), - ], - )), + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name1, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), + ), + value1 is String + ? Text( + value1, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) + : value1, + ], + ))), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - name2, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.44, - ), - ), - Text( - value2, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ), - ], - )) + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name2, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), + ), + value2 is String + ? Text( + value2, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) + : value2, + ], + ))) ], ); } @@ -494,7 +879,10 @@ class _RegisterInfo extends State { insertIMEI() async { var selectedOption = await sharedPref.getInt(LAST_LOGIN); - authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { + authService + .insertDeviceImei(selectedOption) + .then((value) => {goToHome()}) + .catchError((err) { print(err); }); } @@ -507,28 +895,29 @@ class _RegisterInfo extends State { await authenticatedUserObject.getUser(getUser: true); appointmentRateViewModel .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) + .then((value) => + { + getToDoCount(), + GifLoaderDialogUtils.hideDialog(AppGlobal.context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) .catchError((err) { print(err); //GifLoaderDialogUtils.hideDialog(context); @@ -547,8 +936,114 @@ class _RegisterInfo extends State { print(err); }); } + + getCountries() { + ClinicListService service = new ClinicListService(); + service.getCountries().then((res) { + if (res['MessageStatus'] == 1) { + + res['ListNationality'].forEach((items) => { + countriesList.add(CountriesLists.fromJson(items)) + }); + + setState(() {}); + } + }).catchError((err) { + print(err); + }); + } + + + Widget inputWidget(String _labelText, String _hintText, String name, {String prefix, bool isEnable = true, bool hasSelection = false}) { + return Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + // controller: _controller, + onChanged: (value) => { + setState((){ + switch(name) { + case 'fName': + registerInfo.firstNameEn = registerInfo.firstNameAr = value; + break; + case 'sName': + registerInfo.secondNameEn = registerInfo.secondNameAr = value; + break; + case 'lName': + registerInfo.lastNameEn = registerInfo.lastNameAr = value; + break; + } + }) + //_controller.text =value + + }, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); + } + } + class Language { final String name; final String value; diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index bdb2b623..7c6c08a5 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -349,12 +349,19 @@ class _Register extends State { cancelFunction: () {}) .showAlertDialog(context); } else { + final intl.DateFormat dateFormat = intl.DateFormat('dd/MM/yyyy'); nRequest['forRegister'] = true; nRequest['isRegister'] = true; nRequest["PatientIdentificationID"] = nRequest["PatientIdentificationID"].toString(); + nRequest['dob'] = isHijri == 1 ? dob.text : dateFormat.format(selectedDate); + nRequest['isHijri'] = isHijri; sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']); - this.chekUserData(response['LogInTokenID']); + if(request.patientOutSA ==0 ) { + this.chekUserData(response['LogInTokenID']); + }else{ + Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true, isDubai:true))); + } } } else { // if (response['ErrorCode'] == '-986') { diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index f833ad5d..d61e8ef7 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -247,7 +247,7 @@ class AuthProvider with ChangeNotifier { return Future.value(localRes); } - Future checkActivationCode(request, [value]) async { + Future checkActivationCode(request, [value]) async { var neRequest = CheckActivationCodeReq.fromJson(request); neRequest.activationCode = value ?? "0000"; @@ -376,10 +376,16 @@ class AuthProvider with ChangeNotifier { requestN.patientOutSA = requestN.patientobject.patientOutSA; final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); - requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); + if(nhic !=null) { + requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( + dateFormat.parse(nhic['DateOfBirth'])); + requestN.isHijri = nhic['IsHijri'] ? 1 : 0; + requestN.healthId = requestN.patientobject.eHealthIDField; + } + requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; - requestN.healthId = requestN.patientobject.eHealthIDField; - requestN.isHijri = nhic['IsHijri'] ? 1 : 0; + + await sharedPref.remove(USER_PROFILE); dynamic localRes; diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 5079fc9b..8bf3a0ec 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -177,4 +177,14 @@ class ClinicListService extends BaseService { }, body: request); return Future.value(localRes); } + Future getCountries() async { + Map request ={}; + dynamic localRes; + await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); +} } From 907d05c3d0ce737a01f748e94d7e9170922d93de Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 9 May 2023 15:12:19 +0300 Subject: [PATCH 05/12] register --- lib/pages/login/register.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 93f2626d..c3e8a275 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -119,7 +119,7 @@ class _Register extends State { ), Row(children: [ Container( - width: SizeConfig.realScreenWidth * .9, + width: SizeConfig.realScreenWidth * .89, child: isHijri == 1 ? Directionality( textDirection: TextDirection.ltr, From d59e436a9708132ec3a603084a9d827a97171be0 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 10 May 2023 10:15:12 +0300 Subject: [PATCH 06/12] dubai arabic change --- lib/pages/login/register-info.dart | 86 ++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 21 deletions(-) diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 716c2006..ee58f8d5 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -52,23 +52,23 @@ class _RegisterInfo extends State { bool isLoading; int page; final List locationList = [ - new Location(name: 'KSA', value: '1'), - new Location(name: 'Dubai', value: '2'), + new Location(name: 'KSA', value: '1', nameAr: "السعودية"), + new Location(name: 'Dubai', value: '2', nameAr: "دبي"), ]; String language = '1'; CheckPatientAuthenticationReq registerd_data; final List languageList = [ - new Language(name: 'English', value: '2'), - new Language(name: 'Arabic', value: '1'), + new Language(name: 'English', value: '2', nameAr: "إنجليزي"), + new Language(name: 'Arabic', value: '1', nameAr: "عربي"), ]; final List genderList = [ - new Language(name: 'Male', value: 'M'), - new Language(name: 'Female', value: 'F'), + new Language(name: 'Male', value: 'M', nameAr: "ذكر"), + new Language(name: 'Female', value: 'F',nameAr: "أنثى"), ]; final List maritalList = [ - new Language(name: 'Married', value: 'M'), - new Language(name: 'Single', value: 'S'), - new Language(name: 'Divorce', value: 'D'), + new Language(name: 'Married', value: 'M', nameAr: "متزوج"), + new Language(name: 'Single', value: 'S',nameAr: "اعزب"), + new Language(name: 'Divorce', value: 'D',nameAr:"الطلاق"), ]; String email = ''; List countriesList = []; @@ -146,6 +146,14 @@ class _RegisterInfo extends State { .mobileNumber, registerd_data.patientMobileNumber.toString()), // SizedBox(height: 20), + projectViewModel.isArabic ? getnameField( + '', + + + inputWidget( "First Name","First Name English",'fNameEn'), + '', + inputWidget( "Last Name", "Last Name English",'lNameEn'), + ) :SizedBox(height: 0,), getnameField( '', @@ -197,7 +205,8 @@ class _RegisterInfo extends State { (Language value) { return DropdownMenuItem( value: value.value, - child: Text(value.name), + child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , + ), ); }).toList()))), ), @@ -229,7 +238,8 @@ class _RegisterInfo extends State { (Language value) { return DropdownMenuItem( value: value.value, - child: Text(value.name), + child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , + ), ); }).toList()))), TranslationBase @@ -258,7 +268,8 @@ class _RegisterInfo extends State { (CountriesLists value) { return DropdownMenuItem( value: value.iD, - child: Text(value.name), + child: Text(value.name , + ), ); }).toList())))), SizedBox(height: 20), @@ -385,7 +396,8 @@ class _RegisterInfo extends State { value: value.value, child: Text( - value.name), + projectViewModel.isArabic ==1 ? value.nameAr : value.name , + ), ); }).toList()))) ])) @@ -444,7 +456,7 @@ class _RegisterInfo extends State { value: value.value, child: Text( - value.name, + projectViewModel.isArabic ==1 ? value.nameAr : value.name , ), ); }).toList()))) @@ -691,6 +703,7 @@ class _RegisterInfo extends State { this.registerd_data = data2; isDubai = data2.patientOutSA == 1 ? true : false; + if(isDubai) location ='2'; }); } } @@ -802,7 +815,7 @@ class _RegisterInfo extends State { bool isValid() { if ((location != null && language != null && - Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null)) { + Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null) || (projectViewModel.isArabic && registerInfo.firstNameEn !=null && registerInfo.firstNameAr !=null && registerInfo.lastNameEn !=null && registerInfo.secondNameAr !=null && registerInfo.lastNameAr !=null)) { return true; } else { return false; @@ -993,13 +1006,43 @@ class _RegisterInfo extends State { setState((){ switch(name) { case 'fName': - registerInfo.firstNameEn = registerInfo.firstNameAr = value; + { + if(projectViewModel.isArabic) { + registerInfo.firstNameAr = value; + + }else{ + registerInfo.firstNameEn =value; + registerInfo.firstNameAr ='...'; + } + } break; case 'sName': - registerInfo.secondNameEn = registerInfo.secondNameAr = value; + { + if(projectViewModel.isArabic) { + registerInfo.secondNameAr = value; + registerInfo.secondNameEn ='...'; + }else{ + registerInfo.secondNameEn =value; + registerInfo.secondNameAr ='...'; + } + } break; case 'lName': - registerInfo.lastNameEn = registerInfo.lastNameAr = value; + { + if(projectViewModel.isArabic) { + registerInfo.lastNameAr = value; + + }else{ + registerInfo.lastNameEn =value; + registerInfo.lastNameAr ='...'; + } + } + break; + case 'fNameEn': + registerInfo.firstNameEn = value; + break; + case 'lNameEn': + registerInfo.lastNameEn = value; break; } }) @@ -1047,13 +1090,14 @@ class _RegisterInfo extends State { class Language { final String name; final String value; - - Language({this.name, this.value}); + final String nameAr; + Language({this.name, this.value, this.nameAr}); } class Location { final String name; final String value; + final String nameAr; - Location({this.name, this.value}); + Location({this.name, this.value, this.nameAr}); } From 5a741bf270862eedb1ceef880e476403eb12eee1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 10 May 2023 10:41:02 +0300 Subject: [PATCH 07/12] Sickleave changes --- lib/core/service/medical/labs_service.dart | 4 ++-- lib/pages/medical/sickleave_workplace_update_page.dart | 4 +++- lib/widgets/data_display/medical/doctor_card.dart | 2 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index f12e4669..484bfff8 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -115,12 +115,12 @@ class LabsService extends BaseService { return Future.value(localRes); } - Future updateWorkplaceName(String workplaceName, int requestNumber, String setupID, int projectID) async { + Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async { hasError = false; Map body = Map(); body['Placeofwork'] = workplaceName; - body['Placeofworkar'] = workplaceName; + body['Placeofworkar'] = workplaceNameAR; body['Req_ID'] = requestNumber; body['TargetSetupID'] = setupID; body['ProjectID'] = projectID; diff --git a/lib/pages/medical/sickleave_workplace_update_page.dart b/lib/pages/medical/sickleave_workplace_update_page.dart index 47ff2e1a..3b4a1f1b 100644 --- a/lib/pages/medical/sickleave_workplace_update_page.dart +++ b/lib/pages/medical/sickleave_workplace_update_page.dart @@ -222,7 +222,9 @@ class _WorkplaceUpdatePageState extends State { LabsService service = new LabsService(); GifLoaderDialogUtils.showMyDialog(context); - service.updateWorkplaceName(workplaceName.text, widget.requestNumber, widget.setupID, widget.projectID).then((res) { + service + .updateWorkplaceName(projectViewModel.isArabic ? "-" : workplaceName.text, projectViewModel.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID) + .then((res) { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(true); }).catchError((err) { diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index f06d508a..20b2714e 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -116,7 +116,7 @@ class DoctorCard extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 12), + padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e91990b4..f62248b8 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From b304332526d5cbdd59e55ea85d10d871aef0547a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 16 May 2023 09:04:10 +0300 Subject: [PATCH 08/12] Patient app release to stores 10.4 --- ios/Podfile | 1 + lib/config/config.dart | 6 +- lib/config/localized_values.dart | 2 +- lib/core/service/client/base_app_client.dart | 4 +- .../geofencing/GeofencingServices.dart | 2 + .../widgets/LiveCarePendingRequest.dart | 18 +- lib/pages/login/register-info.dart | 1124 +++++++---------- .../medical/patient_sick_leave_page.dart | 16 +- lib/uitl/push-notification-handler.dart | 4 + lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- pubspec.yaml | 2 +- 11 files changed, 489 insertions(+), 694 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index e4393e8d..c92f7e80 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -52,6 +52,7 @@ post_install do |installer| 'PERMISSION_REMINDERS=1', ] build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' + build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' end diff --git a/lib/config/config.dart b/lib/config/config.dart index 96c71d2c..cd192911 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:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -//var BASE_URL = 'https://hmgwebservices.com/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -323,7 +323,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.3; +var VERSION_ID = 10.4; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1c02644e..5fe40ec1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1865,7 +1865,7 @@ const Map localizedValues = { "NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" }, "enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"}, "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"}, - "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم لايف كير"}, + "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"}, "needApproval": {"en": "Your sick leave is under process in medical administration, you will be notified once approved.", "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."}, "pendingActivation": {"en": "Pending Activation", "ar": "في انتظار التنشيط"}, "awaitingApproval": {"en": "Awaiting Approval", "ar": "انتظر القبول"}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index a87d71e7..9cb81a41 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -158,11 +158,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { + // if (AppGlobal.isNetworkDebugEnabled) { 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/geofencing/GeofencingServices.dart b/lib/core/service/geofencing/GeofencingServices.dart index 362416da..fe679984 100644 --- a/lib/core/service/geofencing/GeofencingServices.dart +++ b/lib/core/service/geofencing/GeofencingServices.dart @@ -32,6 +32,8 @@ class GeofencingServices extends BaseService { AppSharedPreferences pref = AppSharedPreferences(); await pref.setString(HMG_GEOFENCES, _zonesJsonString); + var res = await sharedPref.getStringWithDefaultValue(HMG_GEOFENCES, "[]"); + print("-------GEO ZONES----------: $res"); return geoZones; } diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index a866cc0b..a5392c8d 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -96,15 +96,15 @@ class _LiveCarePendingRequestState extends State { child: Text(TranslationBase.of(context).yourTurn + " " + widget.pendingERRequestHistoryList.patCount.toString() + " " + TranslationBase.of(context).patients, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), ), - Row( - children: [ - Container( - padding: const EdgeInsets.all(5.0), - child: Text(TranslationBase.of(context).liveCareSupportContact, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), - ), - Directionality(textDirection: TextDirection.ltr, child: Text("011 525 9553", style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48))) - ], - ), + // Row( + // children: [ + // Container( + // padding: const EdgeInsets.all(5.0), + // child: Text(TranslationBase.of(context).liveCareSupportContact, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), + // ), + // Directionality(textDirection: TextDirection.ltr, child: Text("011 525 9553", style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48))) + // ], + // ), mHeight(12.0), Container( child: DefaultButton(TranslationBase.of(context).callLiveCareSupport, () { diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index ee58f8d5..1b81dbfb 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -6,8 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' - as checkActivation; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as checkActivation; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; @@ -38,8 +37,7 @@ class RegisterInfo extends StatefulWidget { final Function changePageViewIndex; final int page; - const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) - : super(key: key); + const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) : super(key: key); @override _RegisterInfo createState() => _RegisterInfo(); @@ -48,7 +46,7 @@ class RegisterInfo extends StatefulWidget { class _RegisterInfo extends State { final authService = new AuthProvider(); final sharedPref = new AppSharedPreferences(); - RegisterInfoResponse registerInfo =RegisterInfoResponse(); + RegisterInfoResponse registerInfo = RegisterInfoResponse(); bool isLoading; int page; final List locationList = [ @@ -63,25 +61,23 @@ class _RegisterInfo extends State { ]; final List genderList = [ new Language(name: 'Male', value: 'M', nameAr: "ذكر"), - new Language(name: 'Female', value: 'F',nameAr: "أنثى"), + new Language(name: 'Female', value: 'F', nameAr: "أنثى"), ]; final List maritalList = [ new Language(name: 'Married', value: 'M', nameAr: "متزوج"), - new Language(name: 'Single', value: 'S',nameAr: "اعزب"), - new Language(name: 'Divorce', value: 'D',nameAr:"الطلاق"), + new Language(name: 'Single', value: 'S', nameAr: "اعزب"), + new Language(name: 'Divorce', value: 'D', nameAr: "الطلاق"), ]; String email = ''; List countriesList = []; ToDoCountProviderModel toDoProvider; String location = '1'; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); ProjectViewModel projectViewModel; - AppointmentRateViewModel appointmentRateViewModel = - locator(); - bool isDubai =false; + AppointmentRateViewModel appointmentRateViewModel = locator(); + bool isDubai = false; RegisterInfoResponse data = RegisterInfoResponse(); CheckPatientAuthenticationReq data2; String gender = 'M'; @@ -90,15 +86,14 @@ class _RegisterInfo extends State { @override void initState() { - - if(widget.page ==1) { - getCountries(); - } - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getRegisterInfo(); - }); - page = widget.page; - super.initState(); + if (widget.page == 1) { + getCountries(); + } + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getRegisterInfo(); + }); + page = widget.page; + super.initState(); } @override @@ -106,23 +101,17 @@ class _RegisterInfo extends State { projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); return AppScaffold( - appBarTitle: TranslationBase - .of(context) - .register, + appBarTitle: TranslationBase.of(context).register, isShowAppBar: false, isShowDecPage: false, body: SingleChildScrollView( padding: EdgeInsets.all(30), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: < - Widget>[ + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Expanded( child: AppText( - TranslationBase - .of(context) - .personalInfo, + TranslationBase.of(context).personalInfo, fontSize: 16, textAlign: TextAlign.left, fontWeight: FontWeight.bold, @@ -134,395 +123,277 @@ class _RegisterInfo extends State { SizedBox(height: 20), (isDubai && page == 1) ? Column( - children: [ - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .identificationNumber, - registerd_data.patientIdentificationID, - TranslationBase - .of(context) - .mobileNumber, - registerd_data.patientMobileNumber.toString()), - // SizedBox(height: 20), - projectViewModel.isArabic ? getnameField( - '', - - - inputWidget( "First Name","First Name English",'fNameEn'), - '', - inputWidget( "Last Name", "Last Name English",'lNameEn'), - ) :SizedBox(height: 0,), - getnameField( - '', - - - inputWidget( TranslationBase - .of(context) - .firstName, TranslationBase - .of(context) - .firstName,'fName'), - '', - inputWidget( TranslationBase - .of(context) - .middleName, TranslationBase - .of(context) - .middleName,'sName'), - ), - - getnameField( - '', - inputWidget( TranslationBase - .of(context) - .lastName, TranslationBase - .of(context) - .lastName, 'lName'), + children: [ + SizedBox(height: 20), + getnameField(TranslationBase.of(context).identificationNumber, registerd_data.patientIdentificationID, TranslationBase.of(context).mobileNumber, + registerd_data.patientMobileNumber.toString()), + // SizedBox(height: 20), + projectViewModel.isArabic + ? getnameField( + '', + inputWidget("First Name", "First Name English", 'fNameEn'), + '', + inputWidget("Last Name", "Last Name English", 'lNameEn'), + ) + : SizedBox( + height: 0, + ), + getnameField( + '', + inputWidget(TranslationBase.of(context).firstName, TranslationBase.of(context).firstName, 'fName'), + '', + inputWidget(TranslationBase.of(context).middleName, TranslationBase.of(context).middleName, 'sName'), + ), - TranslationBase - .of(context) - .gender, - Container( - height: 20, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: gender, - hint: Text(TranslationBase - .of(context) - .gender), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - gender = value; - registerInfo.gender = value; - }) - }, - items: genderList - .map>( - (Language value) { - return DropdownMenuItem( - value: value.value, - child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , - ), - ); - }).toList()))), - ), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .maritalStatus, - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: maritalStatus, - hint: Text(TranslationBase - .of(context) - .maritalStatus), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - maritalStatus = value; - registerInfo.maritalStatusCode = value; - }) - }, - items: maritalList - .map>( - (Language value) { + getnameField( + '', + inputWidget(TranslationBase.of(context).lastName, TranslationBase.of(context).lastName, 'lName'), + TranslationBase.of(context).gender, + Container( + height: 20, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: gender, + hint: Text(TranslationBase.of(context).gender), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + gender = value; + registerInfo.gender = value; + }) + }, + items: genderList.map>((Language value) { return DropdownMenuItem( value: value.value, - child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, ), ); }).toList()))), - TranslationBase - .of(context) - .nationality, - Container( - height: 22, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: nationality, - hint: Text(TranslationBase - .of(context) - .nationality), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - nationality = value; - registerInfo.nationalityCode = value; - }) - }, - items: countriesList - .map>( - (CountriesLists value) { - return DropdownMenuItem( - value: value.iD, - child: Text(value.name , - ), - ); - }).toList())))), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .dateOfBirth, - registerd_data.dob, - "", ""), - SizedBox(height: 20), - ], - ) + ), + SizedBox(height: 20), + getnameField( + TranslationBase.of(context).maritalStatus, + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: maritalStatus, + hint: Text(TranslationBase.of(context).maritalStatus), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + maritalStatus = value; + registerInfo.maritalStatusCode = value; + }) + }, + items: maritalList.map>((Language value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))), + TranslationBase.of(context).nationality, + Container( + height: 22, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: nationality, + hint: Text(TranslationBase.of(context).nationality), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + nationality = value; + registerInfo.nationalityCode = value; + }) + }, + items: countriesList.map>((CountriesLists value) { + return DropdownMenuItem( + value: value.iD, + child: Text( + value.name, + ), + ); + }).toList())))), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).dateOfBirth, registerd_data.dob, "", ""), + SizedBox(height: 20), + ], + ) : (registerInfo.healthId != null && page == 1) - ? Column( - children: [ - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .identificationNumber, - registerInfo.idNumber, - TranslationBase - .of(context) - .firstName, - registerInfo.firstNameEn == '-' - ? registerInfo.firstNameAr - : registerInfo.firstNameEn), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .middleName, - registerInfo.secondNameEn == '-' - ? registerInfo.secondNameEn - : registerInfo.secondNameEn, - TranslationBase - .of(context) - .lastName, - registerInfo.lastNameEn == '-' - ? registerInfo.lastNameEn - : registerInfo.lastNameEn), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .gender, - registerInfo.maritalStatusCode == 'U' - ? 'Unknown' - : registerInfo.maritalStatusCode == 'M' - ? 'Male' - : 'Female', - TranslationBase - .of(context) - .maritalStatus, - registerInfo.maritalStatus), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .nationality, - registerInfo.nationality, - TranslationBase - .of(context) - .mobileNumber, - registerd_data.patientMobileNumber.toString()), - SizedBox(height: 20), - getnameField(TranslationBase - .of(context) - .dateOfBirth, - registerInfo.dateOfBirth, "", ""), - SizedBox(height: 20), - ], - ) - : widget.page == 2 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only( - left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - TranslationBase - .of(context) - .prefferedLanguage, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: - DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: language, - hint: Text(TranslationBase - .of(context) - .prefferedLanguage), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - language = - value; - }) - }, - items: languageList.map< - DropdownMenuItem< - String>>( - (Language value) { - return DropdownMenuItem< - String>( - value: - value.value, - child: Text( - projectViewModel.isArabic ==1 ? value.nameAr : value.name , - ), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only( - left: 10, right: 10, top: 5, bottom: 25), - 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: 18, - child: - DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: location, - hint: Text( - TranslationBase - .of( - context) - .selectLocation), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - location = - value; - }) - }, - items: locationList.map< - DropdownMenuItem< - String>>( - (Location value) { - return DropdownMenuItem< - String>( - value: - value.value, - child: Text( - projectViewModel.isArabic ==1 ? value.nameAr : value.name , - ), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only( - left: 10, right: 10, top: 5, bottom: 12), - margin: EdgeInsets.only(bottom: 0), - child: Row(children: [ - Flexible( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - TranslationBase - .of(context) - .email, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - child: TextField( - onChanged: (value) { - setState(() { - email = value; - }); - }, - style: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff2B353E), - letterSpacing: -0.44, + ? Column( + children: [ + SizedBox(height: 20), + getnameField(TranslationBase.of(context).identificationNumber, registerInfo.idNumber, TranslationBase.of(context).firstName, + registerInfo.firstNameEn == '-' ? registerInfo.firstNameAr : registerInfo.firstNameEn), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).middleName, registerInfo.secondNameEn == '-' ? registerInfo.secondNameEn : registerInfo.secondNameEn, + TranslationBase.of(context).lastName, registerInfo.lastNameEn == '-' ? registerInfo.lastNameEn : registerInfo.lastNameEn), + SizedBox(height: 20), + getnameField( + TranslationBase.of(context).gender, + registerInfo.maritalStatusCode == 'U' + ? 'Unknown' + : registerInfo.maritalStatusCode == 'M' + ? 'Male' + : 'Female', + TranslationBase.of(context).maritalStatus, + registerInfo.maritalStatus), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).nationality, registerInfo.nationality, TranslationBase.of(context).mobileNumber, registerd_data.patientMobileNumber.toString()), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).dateOfBirth, registerInfo.dateOfBirth, "", ""), + SizedBox(height: 20), + ], + ) + : widget.page == 2 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).prefferedLanguage, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: language, + hint: Text(TranslationBase.of(context).prefferedLanguage), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + language = value; + }) + }, + items: languageList.map>((Language value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), + 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, + ), ), - decoration: InputDecoration( - isDense: true, - hintStyle: TextStyle( + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: location, + hint: Text(TranslationBase.of(context).selectLocation), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + location = value; + }) + }, + items: locationList.map>((Location value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 12), + margin: EdgeInsets.only(bottom: 0), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).email, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + child: TextField( + keyboardType: TextInputType.emailAddress, + onChanged: (value) { + setState(() { + email = value; + }); + }, + style: TextStyle( fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w400, - color: Color(0xff575757), - letterSpacing: -0.56, + color: Color(0xff2B353E), + letterSpacing: -0.44, ), - prefixIconConstraints: - BoxConstraints(minWidth: 50), - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - ), - )) - ])) - ])), - ], - ) - : SizedBox(), + decoration: InputDecoration( + isDense: true, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + )) + ])) + ])), + ], + ) + : SizedBox(), ]), ), bottomSheet: Container( @@ -533,148 +404,105 @@ class _RegisterInfo extends State { Expanded( child: Padding( padding: EdgeInsets.all(10), - child: - DefaultButton(TranslationBase - .of(context) - .cancel, () { + child: DefaultButton(TranslationBase.of(context).cancel, () { Navigator.of(context).pop(); - locator() - .loginRegistration - .registration_cancel( - step: page == 1 - ? 'personal info' - : 'other details'); + locator().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details'); }, textColor: Colors.white, color: Color(0xffD02127))), ), Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton( - page == 1 - ? TranslationBase - .of(context) - .next - : TranslationBase - .of(context) - .register, () { + child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { nextPage(); - page == 1 - ? locator() - .loginRegistration - .registration_personal_info() - : locator() - .loginRegistration - .registration_patient_info(); - }, - textColor: Colors.white, - color: isValid() == true - ? Color(0xff359846) - : Colors.grey)), + page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); + }, textColor: Colors.white, color: isValid() == true ? Color(0xff359846) : Colors.grey)), ), ], ))); } - nextPage() async{ + nextPage() async { if (page == 1) { - if(isDubai) { - await setRegisterData(); + if (isDubai) { + await setRegisterData(); + widget.changePageViewIndex(2); + } else { widget.changePageViewIndex(2); - } - else{ - widget.changePageViewIndex(2); - } + } } else { registerNow(); } } - setRegisterData() async{ + setRegisterData() async { registerInfo.gender = gender; - registerInfo.maritalStatusCode =maritalStatus; - registerInfo.nationalityCode =nationality; - projectViewModel.setRegisterData(registerInfo); - // await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo); + registerInfo.maritalStatusCode = maritalStatus; + registerInfo.nationalityCode = nationality; + projectViewModel.setRegisterData(registerInfo); + // await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo); } + registerNow() { dynamic request; - if(isDubai) + if (isDubai) request = getTempUserRequestDubai(); - else - request = getTempUserRequest(); + else + request = getTempUserRequest(); - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); dynamic res; this .authService .registerUser(request) - .then((result) => - { - GifLoaderDialogUtils.hideDialog(context), - if (result is String) - { - new ConfirmDialog( - context: context, - confirmMessage: result, - okText: TranslationBase - .of(context) - .ok, - cancelText: TranslationBase - .of(context) - .cancel_nocaps, - okFunction: () => - {ConfirmDialog.closeAlertDialog(context)}, - cancelFunction: () => - { - ConfirmDialog.closeAlertDialog(context) - }).showAlertDialog(context) - } - else - { - res = result, - result = checkActivation.CheckActivationCode.fromJson(result), - // result.list.isFamily = false, - // sharedPref.setObject(USER_PROFILE, result.list), - // this.sharedPref.setObject(MAIN_USER, result.list), - // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - // sharedPref.setString(TOKEN, result.authenticationTokenID), - // this.setUser(result), - sharedPref.remove(FAMILY_FILE), - result.list.isFamily = false, - - sharedPref.setString(BLOOD_TYPE, result.patientBloodType), - authenticatedUserObject.user = result.list, - projectViewModel.setPrivilege(privilegeList: res), - sharedPref.setObject(MAIN_USER, result.list), - sharedPref.setObject(USER_PROFILE, result.list), - - sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - sharedPref.setString(TOKEN, result.authenticationTokenID), - AppToast.showSuccessToast( - message: TranslationBase - .of(context) - .successRegister), - checkIfUserAgreedBefore(result), - projectViewModel.analytics.loginRegistration - .registration_confirmation() - } - }) + .then((result) => { + GifLoaderDialogUtils.hideDialog(context), + if (result is String) + { + new ConfirmDialog( + context: context, + confirmMessage: result, + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}).showAlertDialog(context) + } + else + { + res = result, + result = checkActivation.CheckActivationCode.fromJson(result), + // result.list.isFamily = false, + // sharedPref.setObject(USER_PROFILE, result.list), + // this.sharedPref.setObject(MAIN_USER, result.list), + // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + // sharedPref.setString(TOKEN, result.authenticationTokenID), + // this.setUser(result), + sharedPref.remove(FAMILY_FILE), + result.list.isFamily = false, + + sharedPref.setString(BLOOD_TYPE, result.patientBloodType), + authenticatedUserObject.user = result.list, + projectViewModel.setPrivilege(privilegeList: res), + sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(USER_PROFILE, result.list), + + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + AppToast.showSuccessToast(message: TranslationBase.of(context).successRegister), + checkIfUserAgreedBefore(result), + projectViewModel.analytics.loginRegistration.registration_confirmation() + } + }) .catchError((err) { // GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: err, - okText: TranslationBase - .of(context) - .confirm, - cancelText: TranslationBase - .of(context) - .cancel_nocaps, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - projectViewModel.analytics.loginRegistration - .registration_fail(errorType: err); + projectViewModel.analytics.loginRegistration.registration_fail(errorType: err); }); } @@ -688,45 +516,33 @@ class _RegisterInfo extends State { } getRegisterInfo() async { - if (await sharedPref.getObject(NHIC_DATA) != null) { - data = - RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); this.registerInfo = data; } if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { - data2 = CheckPatientAuthenticationReq.fromJson( - await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + data2 = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); setState(() { - - this.registerd_data = data2; isDubai = data2.patientOutSA == 1 ? true : false; - if(isDubai) location ='2'; + if (isDubai) location = '2'; }); } } getTempUserRequest() { - - DateFormat dateFormat = DateFormat("mm/dd/yyyy"); print(dateFormat.parse(registerInfo.dateOfBirth)); - var hDate = - new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); + var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); var date = hDate.toString(); return { "Patientobject": { "TempValue": true, - "PatientIdentificationType": - registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationNo": registerInfo.idNumber, "MobileNumber": registerd_data.patientMobileNumber, - "PatientOutSA": (registerd_data.zipCode == '966' || - registerd_data.zipCode == '+966') - ? 0 - : 1, + "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, "FirstNameN": registerInfo.firstNameAr, "FirstName": registerInfo.firstNameEn, "MiddleNameN": registerInfo.secondNameAr, @@ -734,9 +550,8 @@ class _RegisterInfo extends State { "LastNameN": registerInfo.lastNameAr, "LastName": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, - "DateofBirth": DateUtil.convertISODateToJsonDate( - registerInfo.dateOfBirth.replaceAll('/', '-')), - "Gender": registerInfo.gender== 'M' ? 1 : 2, + "DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth.replaceAll('/', '-')), + "Gender": registerInfo.gender == 'M' ? 1 : 2, "NationalityID": registerInfo.nationalityCode, "eHealthIDField": registerInfo.healthId, "DateofBirthN": date, @@ -746,24 +561,19 @@ class _RegisterInfo extends State { "Marital": registerInfo.maritalStatusCode == 'U' ? '0' : registerInfo.maritalStatusCode == 'M' - ? '1' - : '2', + ? '1' + : '2', }, "PatientIdentificationID": registerInfo.idNumber, - "PatientMobileNumber": - registerd_data.patientMobileNumber.toString()[0] == '0' - ? registerd_data.patientMobileNumber - : '0' + registerd_data.patientMobileNumber.toString(), + "PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(), }; } - - getTempUserRequestDubai(){ + getTempUserRequestDubai() { DateFormat dateFormat = DateFormat("mm/dd/yyyy"); - registerInfo= projectViewModel.registerInfo; + registerInfo = projectViewModel.registerInfo; print(dateFormat.parse(registerd_data.dob)); - var hDate = - new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); + var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); var date = hDate.toString(); final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); @@ -771,27 +581,21 @@ class _RegisterInfo extends State { return { "Patientobject": { "TempValue": true, - "PatientIdentificationType": - registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationType": registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationNo": registerd_data.patientIdentificationID, "MobileNumber": registerd_data.patientMobileNumber, - "PatientOutSA": (registerd_data.zipCode == '966' || - registerd_data.zipCode == '+966') - ? 0 - : 1, - "FirstNameN": registerInfo.firstNameAr ??"", - "FirstName": registerInfo.firstNameEn??"", - "MiddleNameN": registerInfo.secondNameAr?? "", - "MiddleName": registerInfo.secondNameEn ??"", - "LastNameN": registerInfo.lastNameAr ??"", - "LastName":registerInfo.lastNameEn ??"", - "StrDateofBirth": dateFormat1.format( - dateFormat2.parse(registerd_data.dob)), - "DateofBirth": DateUtil.convertISODateToJsonDate( - registerd_data.dob.replaceAll('/', '-')), - "Gender": registerInfo.gender== 'M' ? 1 : 2, + "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, + "FirstNameN": registerInfo.firstNameAr ?? "", + "FirstName": registerInfo.firstNameEn ?? "", + "MiddleNameN": registerInfo.secondNameAr ?? ".", + "MiddleName": registerInfo.secondNameEn ?? ".", + "LastNameN": registerInfo.lastNameAr ?? "", + "LastName": registerInfo.lastNameEn ?? "", + "StrDateofBirth": dateFormat1.format(dateFormat2.parse(registerd_data.dob)), + "DateofBirth": DateUtil.convertISODateToJsonDate(registerd_data.dob.replaceAll('/', '-')), + "Gender": registerInfo.gender == 'M' ? 1 : 2, "NationalityID": registerInfo.nationalityCode, - "eHealthIDField":null, + "eHealthIDField": null, "DateofBirthN": date, "EmailAddress": email, "SourceType": location, @@ -799,23 +603,20 @@ class _RegisterInfo extends State { "Marital": registerInfo.maritalStatusCode == 'U' ? '0' : registerInfo.maritalStatusCode == 'M' - ? '1' - : '2', + ? '1' + : '2', }, "PatientIdentificationID": registerd_data.patientIdentificationID, - "PatientMobileNumber": - registerd_data.patientMobileNumber.toString()[0] == '0' - ? registerd_data.patientMobileNumber - : '0' + registerd_data.patientMobileNumber.toString(), - "DOB":registerd_data.dob, - "IsHijri":registerd_data.isHijri + "PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(), + "DOB": registerd_data.dob, + "IsHijri": registerd_data.isHijri }; } bool isValid() { - if ((location != null && - language != null && - Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null) || (projectViewModel.isArabic && registerInfo.firstNameEn !=null && registerInfo.firstNameAr !=null && registerInfo.lastNameEn !=null && registerInfo.secondNameAr !=null && registerInfo.lastNameAr !=null)) { + if ((location != null && language != null && Utils.validEmail(email) == true) || + (registerInfo.firstNameEn != null && registerInfo.lastNameEn != null) || + (projectViewModel.isArabic && registerInfo.firstNameEn != null && registerInfo.firstNameAr != null && registerInfo.lastNameEn != null && registerInfo.lastNameAr != null)) { return true; } else { return false; @@ -841,13 +642,13 @@ class _RegisterInfo extends State { ), value1 is String ? Text( - value1, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ) + value1, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) : value1, ], ))), @@ -867,13 +668,13 @@ class _RegisterInfo extends State { ), value2 is String ? Text( - value2, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ) + value2, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) : value2, ], ))) @@ -892,10 +693,7 @@ class _RegisterInfo extends State { insertIMEI() async { var selectedOption = await sharedPref.getInt(LAST_LOGIN); - authService - .insertDeviceImei(selectedOption) - .then((value) => {goToHome()}) - .catchError((err) { + authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { print(err); }); } @@ -908,29 +706,28 @@ class _RegisterInfo extends State { await authenticatedUserObject.getUser(getUser: true); appointmentRateViewModel .getIsLastAppointmentRatedList() - .then((value) => - { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) + .then((value) => { + getToDoCount(), + GifLoaderDialogUtils.hideDialog(AppGlobal.context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) .catchError((err) { print(err); //GifLoaderDialogUtils.hideDialog(context); @@ -954,19 +751,15 @@ class _RegisterInfo extends State { ClinicListService service = new ClinicListService(); service.getCountries().then((res) { if (res['MessageStatus'] == 1) { + res['ListNationality'].forEach((items) => {countriesList.add(CountriesLists.fromJson(items))}); - res['ListNationality'].forEach((items) => { - countriesList.add(CountriesLists.fromJson(items)) - }); - - setState(() {}); + setState(() {}); } }).catchError((err) { print(err); }); } - Widget inputWidget(String _labelText, String _hintText, String name, {String prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5), @@ -1000,54 +793,51 @@ class _RegisterInfo extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.text, // controller: _controller, onChanged: (value) => { - setState((){ - switch(name) { - case 'fName': - { - if(projectViewModel.isArabic) { - registerInfo.firstNameAr = value; - - }else{ - registerInfo.firstNameEn =value; - registerInfo.firstNameAr ='...'; - } - } - break; - case 'sName': - { - if(projectViewModel.isArabic) { - registerInfo.secondNameAr = value; - registerInfo.secondNameEn ='...'; - }else{ - registerInfo.secondNameEn =value; - registerInfo.secondNameAr ='...'; - } - } - break; - case 'lName': - { - if(projectViewModel.isArabic) { - registerInfo.lastNameAr = value; - - }else{ - registerInfo.lastNameEn =value; - registerInfo.lastNameAr ='...'; - } - } - break; - case 'fNameEn': - registerInfo.firstNameEn = value; - break; - case 'lNameEn': - registerInfo.lastNameEn = value; - break; - } + setState(() { + switch (name) { + case 'fName': + { + if (projectViewModel.isArabic) { + registerInfo.firstNameAr = value; + } else { + registerInfo.firstNameEn = value; + registerInfo.firstNameAr = '...'; + } + } + break; + case 'sName': + { + if (projectViewModel.isArabic) { + registerInfo.secondNameAr = value.isEmpty ? "." : value; + registerInfo.secondNameEn = '...'; + } else { + registerInfo.secondNameEn = value.isEmpty ? "." : value; + registerInfo.secondNameAr = '...'; + } + } + break; + case 'lName': + { + if (projectViewModel.isArabic) { + registerInfo.lastNameAr = value; + } else { + registerInfo.lastNameEn = value; + registerInfo.lastNameAr = '...'; + } + } + break; + case 'fNameEn': + registerInfo.firstNameEn = value; + break; + case 'lNameEn': + registerInfo.lastNameEn = value; + break; + } }) //_controller.text =value - }, style: TextStyle( fontSize: 14, @@ -1067,7 +857,6 @@ class _RegisterInfo extends State { letterSpacing: -0.56, ), prefixIconConstraints: BoxConstraints(minWidth: 50), - contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, @@ -1083,14 +872,13 @@ class _RegisterInfo extends State { ), ); } - } - class Language { final String name; final String value; final String nameAr; + Language({this.name, this.value, this.nameAr}); } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index f132741e..1ca32e02 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - isSickLeave: true, - sickLeaveStatus: model.sickLeaveList[index].status, + // isSickLeave: true, + // sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - if (model.sickLeaveList[index].status == 1) { - openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - } else if (model.sickLeaveList[index].status == 2) { + // if (model.sickLeaveList[index].status == 1) { + // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + // } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - } else { - showApprovalDialog(); - } + // } else { + // showApprovalDialog(); + // } } void showApprovalDialog() { diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index d8b59782..3e765c17 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -303,6 +303,10 @@ class PushNotificationHandler { onToken(token); }); + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value); + }); + FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f62248b8..e91990b4 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index 46d8b2f1..834913a8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.62+1 +version: 4.5.63+1 environment: sdk: ">=2.7.0 <3.0.0" From fcf0c589a0917cfae7de1f1f1c94345e79042803 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 21 May 2023 12:21:10 +0300 Subject: [PATCH 09/12] Updates & fixes --- .../all_habib_medical_service_page2.dart | 62 ++- .../h2o/h20_setting.dart | 2 +- lib/pages/DrawerPages/family/my-family.dart | 2 +- .../fragments/home_page_fragment2.dart | 13 +- lib/pages/landing/widgets/services_view.dart | 363 ++++++++++++------ lib/pages/medical/allergies_page.dart | 2 +- .../vital_sing_chart_blood_pressure.dart | 2 +- 7 files changed, 293 insertions(+), 153 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart index 5d0694ed..779c230e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart @@ -65,29 +65,53 @@ class _AllHabibMedicalSevicePage2State extends State initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCareTitle, TranslationBase.of(context).liveCareSubtitle, "assets/images/new/Live_Care.svg", isLogin)); - hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); - hmgServices.add(new HmgServices(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); - hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); - hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); - hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); - hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); - hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); - hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); - hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); - hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); + + hmgServices.add(new HmgServices(6, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); + hmgServices.add(new HmgServices(8, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(new HmgServices(9, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + hmgServices.add(new HmgServices(10, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); + hmgServices.add(new HmgServices(11, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); + hmgServices.add(new HmgServices(12, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(13, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); + hmgServices.add(new HmgServices(14, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin)); - hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); - hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); + + hmgServices.add(new HmgServices(17, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); + + hmgServices.add(new HmgServices(18, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin)); hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin)); - hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); - hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); + hmgServices.add(new HmgServices(21, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); + + hmgServices.add(new HmgServices(22, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); + + + // hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + // hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); + // hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); + // hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); + // hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); + // hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + // hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); + // hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); + // hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); + // hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + // hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); + // hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin)); + // hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); + // hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); + // hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin)); + // hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin)); + // hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); + // hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); } @override @@ -211,7 +235,7 @@ class _AllHabibMedicalSevicePage2State extends State itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index); + return ServicesView(hmgServices[index], index, false); }, ), ), diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index 38d7a568..2feb7f0f 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -350,7 +350,7 @@ class _H2oSettingState extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.text, controller: _controller, onChanged: (value) => { // validateForm() diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index d9f15af8..f7d58b36 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -447,9 +447,9 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) { - GifLoaderDialogUtils.hideDialog(context); setState(() { sharedPref.remove(FAMILY_FILE); + checkUserData(); }); } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index ee856487..9111c2ab 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -52,14 +52,15 @@ class _HomePageFragment2State extends State { initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); - hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + + hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); } @@ -270,7 +271,7 @@ class _HomePageFragment2State extends State { itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index); + return ServicesView(hmgServices[index], index, true); }, ), ), diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 1a505e03..f1753f3c 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -22,6 +22,7 @@ import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-locat import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; @@ -39,7 +40,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../../locator.dart'; -import '../landing_page.dart'; import '../landing_page_pharmcy.dart'; class ServicesView extends StatelessWidget { @@ -49,133 +49,18 @@ class ServicesView extends StatelessWidget { AuthProvider authProvider = new AuthProvider(); PharmacyModuleViewModel pharmacyModuleViewModel = locator(); LocationUtils locationUtils; + bool isHomePage; - ServicesView(this.hmgServices, this.index); + ServicesView(this.hmgServices, this.index, this.isHomePage); @override Widget build(BuildContext context) { return InkWell( onTap: () { - if (index == 0) { - openLiveCare(context); - } else if (index == 1) { - showCovidDialog(context); - locator().hmgServices.logServiceName('covid-test drive-thru'); - } else if (index == 2) { - Navigator.push(context, FadePage(page: PaymentService())); - locator().hmgServices.logServiceName('online payments'); - } else if (index == 3) { - Navigator.push(context, FadePage(page: HomeHealthCarePage())); - locator().hmgServices.logServiceName('home health care'); - } else if (index == 4) { - Navigator.push(context, FadePage(page: CMCPage())); - locator().hmgServices.logServiceName('comprehensive medical checkup'); - } else if (index == 5) { - Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); - locator().hmgServices.logServiceName('emergency service'); - } else if (index == 6) { - Navigator.push(context, FadePage(page: EReferralPage())); - locator().hmgServices.logServiceName('e-referral service'); - } else if (index == 7) { - Navigator.push(context, FadePage(page: H2OPage())); - locator().hmgServices.logServiceName('water consumption'); - } else if (index == 8) { - Navigator.push(context, FadePage(page: ContactUsPage())); - locator().hmgServices.logServiceName('find us reach us'); - } else if (index == 9) { - Navigator.push( - context, - FadePage( - page: MedicalProfilePageNew(), - ), - ); - locator().hmgServices.logServiceName('my medical details'); - } else if (index == 10) { - Navigator.push( - context, - FadePage( - page: Search(), - ), - ); - locator().hmgServices.logServiceName('book appointment'); - } else if (index == 11) { - getPharmacyToken(context); - locator().hmgServices.logServiceName('al habib pharmacy'); - } else if (index == 12) { - Navigator.push( - context, - FadePage( - page: InsuranceUpdate(), - ), - ); - locator().hmgServices.logServiceName('update insurance'); - } else if (index == 13) { - Navigator.push( - context, - FadePage( - page: MyFamily(), - ), - ); - locator().hmgServices.logServiceName('my family files'); - } else if (index == 14) { - Navigator.push( - context, - FadePage(page: ChildInitialPage()), - ); - locator().hmgServices.logServiceName('my child vaccines'); - } else if (index == 15) { - // Navigator.pop(context); - LandingPage.shared.switchToDoFromHMGServices(); - locator().hmgServices.logServiceName('todo list'); - } else if (index == 16) { - Navigator.push( - context, - FadePage(page: BloodDonationPage()), - ); - locator().hmgServices.logServiceName('blood donation'); - } else if (index == 17) { - Navigator.push( - context, - FadePage( - page: (HealthCalculators()), - ), - ); - locator().hmgServices.logServiceName('health calculator'); - } else if (index == 18) { - Navigator.push( - context, - FadePage( - page: HealthConverter(), - ), - ); - locator().hmgServices.logServiceName('heath converters'); - } else if (index == 19) { - Navigator.push( - context, - FadePage(page: SmartWatchInstructions()), - ); - locator().hmgServices.logServiceName('smart watches'); - } else if (index == 20) { - locator().hmgServices.logServiceName('car parcking service'); - Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ); - } else if (index == 21) { - launch("https://hmgwebservices.com/vt_mobile/html/index.html"); - locator().hmgServices.logServiceName('virtual tour'); - } else if (index == 22) { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyWebView( - title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ), - ), - ); - locator().hmgServices.logServiceName('latest news'); + if (isHomePage) { + handleHomePageServices(hmgServices, context); + } else { + handleAllServices(hmgServices, context); } }, child: Container( @@ -202,7 +87,7 @@ class ServicesView extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Opacity( opacity: 0.04, - child: hmgServices.action == 2 + child: hmgServices.action == 5 ? Image.asset( hmgServices.icon, width: double.infinity, @@ -231,7 +116,7 @@ class ServicesView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ mFlex(1), - hmgServices.action == 2 + hmgServices.action == (isHomePage ? 5 : 8) ? Image.asset( hmgServices.icon, height: index == 0 ? MediaQuery.of(context).size.width / 18 : MediaQuery.of(context).size.width / 18, @@ -278,6 +163,236 @@ class ServicesView extends StatelessWidget { ); } + handleHomePageServices(HmgServices hmgServices, BuildContext context) { + if (hmgServices.action == 0) { + Navigator.push(context, FadePage(page: Search())); + locator().hmgServices.logServiceName('book appointment'); + } else if (hmgServices.action == 1) { + openLiveCare(context); + } else if (hmgServices.action == 2) { + Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); + } else if (hmgServices.action == 3) { + Navigator.push(context, FadePage(page: HomeHealthCarePage())); + locator().hmgServices.logServiceName('home health care'); + } else if (hmgServices.action == 4) { + Navigator.push(context, FadePage(page: CMCPage())); + locator().hmgServices.logServiceName('comprehensive medical checkup'); + } else if (hmgServices.action == 5) { + Navigator.push(context, FadePage(page: PaymentService())); + locator().hmgServices.logServiceName('online payments'); + } else if (hmgServices.action == 6) { + Navigator.push(context, FadePage(page: EReferralPage())); + locator().hmgServices.logServiceName('e-referral service'); + } else if (hmgServices.action == 7) { + showCovidDialog(context); + locator().hmgServices.logServiceName('covid-test drive-thru'); + } else if (hmgServices.action == 8) { + Navigator.push(context, FadePage(page: ContactUsPage())); + locator().hmgServices.logServiceName('find us reach us'); + } + } + + handleAllServices(HmgServices hmgServices, BuildContext context) { + if (hmgServices.action == 0) { + Navigator.push(context, FadePage(page: Search())); + locator().hmgServices.logServiceName('book appointment'); + } else if (hmgServices.action == 1) { + openLiveCare(context); + } else if (hmgServices.action == 2) { + Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); + } else if (hmgServices.action == 3) { + Navigator.push(context, FadePage(page: HomeHealthCarePage())); + locator().hmgServices.logServiceName('home health care'); + } else if (hmgServices.action == 4) { + Navigator.push(context, FadePage(page: CMCPage())); + locator().hmgServices.logServiceName('comprehensive medical checkup'); + } else if (hmgServices.action == 5) { + getPharmacyToken(context); + locator().hmgServices.logServiceName('al habib pharmacy'); + } else if (hmgServices.action == 6) { + Navigator.push(context, FadePage(page: MedicalProfilePageNew())); + } else if (hmgServices.action == 7) { + Navigator.push(context, FadePage(page: MyFamily())); + locator().hmgServices.logServiceName('my family files'); + } else if (hmgServices.action == 8) { + Navigator.push(context, FadePage(page: PaymentService())); + locator().hmgServices.logServiceName('online payments'); + } else if (hmgServices.action == 9) { + Navigator.push(context, FadePage(page: ChildInitialPage())); + locator().hmgServices.logServiceName('my child vaccines'); + } else if (hmgServices.action == 10) { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + locator().hmgServices.logServiceName('update insurance'); + } else if (hmgServices.action == 11) { + Navigator.push(context, FadePage(page: EReferralPage())); + locator().hmgServices.logServiceName('e-referral service'); + } else if (hmgServices.action == 12) { + Navigator.push(context, FadePage(page: H2OPage())); + locator().hmgServices.logServiceName('water consumption'); + } else if (hmgServices.action == 13) { + Navigator.push(context, FadePage(page: (HealthCalculators()))); + locator().hmgServices.logServiceName('health calculator'); + } else if (hmgServices.action == 14) { + Navigator.push(context, FadePage(page: HealthConverter())); + locator().hmgServices.logServiceName('heath converters'); + } else if (hmgServices.action == 15) { + Navigator.pop(context); + LandingPage.shared.switchToDoFromHMGServices(); + locator().hmgServices.logServiceName('todo list'); + } else if (hmgServices.action == 16) { + Navigator.push(context, FadePage(page: BloodDonationPage())); + locator().hmgServices.logServiceName('blood donation'); + } else if (hmgServices.action == 17) { + showCovidDialog(context); + locator().hmgServices.logServiceName('covid-test drive-thru'); + } else if (hmgServices.action == 18) { + launch("https://hmgwebservices.com/vt_mobile/html/index.html"); + locator().hmgServices.logServiceName('virtual tour'); + } else if (hmgServices.action == 19) { + Navigator.push(context, FadePage(page: SmartWatchInstructions())); + locator().hmgServices.logServiceName('smart watches'); + } else if (hmgServices.action == 20) { + Navigator.push(context, FadePage(page: ParkingPage())); + locator().hmgServices.logServiceName('car parcking service'); + } else if (hmgServices.action == 21) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => MyWebView( + title: "HMG News", + selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ), + ), + ); + locator().hmgServices.logServiceName('latest news'); + } else if (hmgServices.action == 22) { + Navigator.push(context, FadePage(page: ContactUsPage())); + locator().hmgServices.logServiceName('find us reach us'); + } + + // if (hmgServices.action == 10) { + // openLiveCare(context); + // } else if (index == 1) { + // showCovidDialog(context); + // locator().hmgServices.logServiceName('covid-test drive-thru'); + // } else if (index == 2) { + // Navigator.push(context, FadePage(page: PaymentService())); + // locator().hmgServices.logServiceName('online payments'); + // } else if (index == 3) { + // Navigator.push(context, FadePage(page: HomeHealthCarePage())); + // locator().hmgServices.logServiceName('home health care'); + // } else if (index == 4) { + // Navigator.push(context, FadePage(page: CMCPage())); + // locator().hmgServices.logServiceName('comprehensive medical checkup'); + // } else if (index == 5) { + // Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + // locator().hmgServices.logServiceName('emergency service'); + // } else if (index == 6) { + // Navigator.push(context, FadePage(page: EReferralPage())); + // locator().hmgServices.logServiceName('e-referral service'); + // } else if (index == 7) { + // Navigator.push(context, FadePage(page: H2OPage())); + // locator().hmgServices.logServiceName('water consumption'); + // } else if (index == 8) { + // Navigator.push(context, FadePage(page: ContactUsPage())); + // locator().hmgServices.logServiceName('find us reach us'); + // } else if (index == 9) { + // Navigator.push( + // context, + // FadePage( + // page: MedicalProfilePageNew(), + // ), + // ); + // locator().hmgServices.logServiceName('my medical details'); + // } else if (index == 10) { + // Navigator.push( + // context, + // FadePage( + // page: Search(), + // ), + // ); + // locator().hmgServices.logServiceName('book appointment'); + // } else if (index == 11) { + // getPharmacyToken(context); + // locator().hmgServices.logServiceName('al habib pharmacy'); + // } else if (index == 12) { + // Navigator.push( + // context, + // FadePage( + // page: InsuranceUpdate(), + // ), + // ); + // locator().hmgServices.logServiceName('update insurance'); + // } else if (index == 13) { + // Navigator.push( + // context, + // FadePage( + // page: MyFamily(), + // ), + // ); + // locator().hmgServices.logServiceName('my family files'); + // } else if (index == 14) { + // Navigator.push( + // context, + // FadePage(page: ChildInitialPage()), + // ); + // locator().hmgServices.logServiceName('my child vaccines'); + // } else if (index == 15) { + // LandingPage.shared.switchToDoFromHMGServices(); + // locator().hmgServices.logServiceName('todo list'); + // } else if (index == 16) { + // Navigator.push( + // context, + // FadePage(page: BloodDonationPage()), + // ); + // locator().hmgServices.logServiceName('blood donation'); + // } else if (index == 17) { + // Navigator.push( + // context, + // FadePage( + // page: (HealthCalculators()), + // ), + // ); + // locator().hmgServices.logServiceName('health calculator'); + // } else if (index == 18) { + // Navigator.push( + // context, + // FadePage( + // page: HealthConverter(), + // ), + // ); + // locator().hmgServices.logServiceName('heath converters'); + // } else if (index == 19) { + // Navigator.push( + // context, + // FadePage(page: SmartWatchInstructions()), + // ); + // locator().hmgServices.logServiceName('smart watches'); + // } else if (index == 20) { + // locator().hmgServices.logServiceName('car parcking service'); + // Navigator.push( + // context, + // FadePage( + // page: ParkingPage(), + // ), + // ); + // } else if (index == 21) { + // launch("https://hmgwebservices.com/vt_mobile/html/index.html"); + // locator().hmgServices.logServiceName('virtual tour'); + // } else if (index == 22) { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (BuildContext context) => MyWebView( + // title: "HMG News", + // selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + // ), + // ), + // ); + // locator().hmgServices.logServiceName('latest news'); + // } + } + showCovidDialog(BuildContext context) { if (Platform.isAndroid) { showDialog( diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index e83cf1d5..b3f54a60 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -47,7 +47,7 @@ class AllergiesPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).remarks+" :"), - Texts(TranslationBase.of(context).description + model.allergies[index].description ?? ''), + Texts(TranslationBase.of(context).description + ": " + model.allergies[index].description ?? ''), ], ), ) diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart index 424b0c90..2d04e91a 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart @@ -35,7 +35,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); generateData(); return SingleChildScrollView( child: Column( From 555898c822487c7bb70dea78ce74533753608ede Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 22 May 2023 09:34:08 +0300 Subject: [PATCH 10/12] updates --- PatientAppAPNSAuthKey.p8 | 6 + android/app/src/main/AndroidManifest.xml | 3 + .../geofence/HMG_Geofence.kt | 186 +++++++++++------- ios/Runner.xcodeproj/project.pbxproj | 62 +++--- pubspec.yaml | 2 +- 5 files changed, 159 insertions(+), 100 deletions(-) create mode 100755 PatientAppAPNSAuthKey.p8 diff --git a/PatientAppAPNSAuthKey.p8 b/PatientAppAPNSAuthKey.p8 new file mode 100755 index 00000000..0515964e --- /dev/null +++ b/PatientAppAPNSAuthKey.p8 @@ -0,0 +1,6 @@ +-----BEGIN PRIVATE KEY----- +MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgJ5XRSnefd1apSG/z +YJTQ55ffLMlPgKlGM9edg88mUZagCgYIKoZIzj0DAQehRANCAATSA2MbS+J0cQsc +uBU0xaoxOUgGvnHCQSEK4t22i8eeKPPhH6RHJhK1ugPvj+Eyadf7j6pn3QRonEJu +mIL+qvqC +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index de6f8030..42fc0237 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,6 +6,9 @@ In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> + + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt index 5e7fe57b..8452a083 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -30,12 +30,12 @@ enum class GeofenceTransition(val value: Int) { fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value } } - fun named():String{ - if (value == 1)return "Enter" - if (value == 2)return "Exit" - if (value == 4)return "dWell" - if (value == (ENTER.value or EXIT.value))return "Enter or Exit" - if (value == (DWELL.value or EXIT.value))return "DWell or Exit" + fun named(): String { + if (value == 1) return "Enter" + if (value == 2) return "Exit" + if (value == 4) return "dWell" + if (value == (ENTER.value or EXIT.value)) return "Enter or Exit" + if (value == (DWELL.value or EXIT.value)) return "DWell or Exit" return "unknown" } } @@ -44,63 +44,65 @@ class HMG_Geofence { // https://developer.android.com/training/location/geofencing#java private lateinit var context: Context - private lateinit var preferences:SharedPreferences + private lateinit var preferences: SharedPreferences private val gson = Gson() - private lateinit var geofencingClient:GeofencingClient + private lateinit var geofencingClient: GeofencingClient private val geofencePendingIntent: PendingIntent by lazy { val intent = Intent(context, GeofenceBroadcastReceiver::class.java) PendingIntent.getBroadcast( - context, - 0, - intent, - PendingIntent.FLAG_UPDATE_CURRENT) + context, + 0, + intent, + PendingIntent.FLAG_IMMUTABLE + ) } - companion object{ + companion object { var instance: HMG_Geofence? = null - fun shared(context: Context) : HMG_Geofence { - if (instance == null) { + fun shared(context: Context): HMG_Geofence { + if (instance == null) { instance = HMG_Geofence() instance?.context = context instance?.geofencingClient = LocationServices.getGeofencingClient(context) - instance?.preferences = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + instance?.preferences = + context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) } - return instance!! + return instance!! } } - fun limitize(zones: List):List{ + private fun limitize(zones: List): List { var geoZones_ = zones - if(zones.size > 100) + if (zones.size > 100) geoZones_ = zones.subList(0, 99) return geoZones_ } - fun register(completion:((Boolean, java.lang.Exception?)->Unit)){ + fun register(completion: ((Boolean, java.lang.Exception?) -> Unit)) { unRegisterAll { status, exception -> val geoZones = getGeoZonesFromPreference(context) - doRegister(geoZones){ status_, error -> + doRegister(geoZones) { status_, error -> completion.let { it(status_, error) } } } } - fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit){ + fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit) { getActiveGeofences({ success -> removeActiveGeofences() - if(success.isNotEmpty()) + if (success.isNotEmpty()) geofencingClient - .removeGeofences(success) - .addOnSuccessListener { - completion(true, null) - } - .addOnFailureListener { - completion(false, it) - saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) - } + .removeGeofences(success) + .addOnSuccessListener { + completion(true, null) + } + .addOnFailureListener { + completion(false, it) + saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) + } else completion(true, null) @@ -109,7 +111,10 @@ class HMG_Geofence { }) } - private fun doRegister(geoZones: List, completion:((Boolean, java.lang.Exception?)->Unit)? = null){ + private fun doRegister( + geoZones: List, + completion: ((Boolean, java.lang.Exception?) -> Unit)? = null + ) { if (geoZones.isEmpty()) return @@ -117,9 +122,9 @@ class HMG_Geofence { fun buildGeofencingRequest(geofences: List): GeofencingRequest { return GeofencingRequest.Builder() - .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL) - .addGeofences(geofences) - .build() + .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL) + .addGeofences(geofences) + .build() } getActiveGeofences({ active -> @@ -135,26 +140,41 @@ class HMG_Geofence { if (checkPermission() && geofences.isNotEmpty()) { geofencingClient - .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) - .addOnSuccessListener { - Logs.RegisterGeofence.save(context,"SUCCESS", "Successfuly registered the geofences", Logs.STATUS.SUCCESS) - saveActiveGeofence(geofences.map { it.requestId }, listOf()) - completion?.let { it(true,null) } - } - .addOnFailureListener { exc -> - Logs.RegisterGeofence.save(context,"FAILED_TO_REGISTER", "Failed to register geofence",Logs.STATUS.ERROR) - completion?.let { it(false,exc) } - } + .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) + .addOnSuccessListener { + Logs.RegisterGeofence.save( + context, + "SUCCESS", + "Successfuly registered the geofences", + Logs.STATUS.SUCCESS + ) + saveActiveGeofence(geofences.map { it.requestId }, listOf()) + completion?.let { it(true, null) } + } + .addOnFailureListener { exc -> + Logs.RegisterGeofence.save( + context, + "FAILED_TO_REGISTER", + "Failed to register geofence", + Logs.STATUS.ERROR + ) + completion?.let { it(false, exc) } + } // Schedule the job to register after specified duration (due to: events not calling after long period.. days or days [Needs to register fences again]) - HMGUtils.scheduleJob(context, ReregisterGeofenceJobService::class.java,ReregisterGeofenceJobService.JobID, ReregisterGeofenceJobService.TriggerIntervalDuration) + HMGUtils.scheduleJob( + context, + ReregisterGeofenceJobService::class.java, + ReregisterGeofenceJobService.JobID, + ReregisterGeofenceJobService.TriggerIntervalDuration + ) } }, null) } - fun getGeoZonesFromPreference(context: Context):List{ + fun getGeoZonesFromPreference(context: Context): List { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val json = pref.getString(PREF_KEY_HMG_ZONES, "[]") @@ -162,26 +182,29 @@ class HMG_Geofence { return geoZones } - fun saveActiveGeofence(success: List, failed: List){ + fun saveActiveGeofence(success: List, failed: List) { val jsonSuccess = gson.toJson(success) val jsonFailure = gson.toJson(failed) preferences.edit().putString(PREF_KEY_SUCCESS, jsonSuccess).apply() preferences.edit().putString(PREF_KEY_FAILED, jsonFailure).apply() } - fun removeActiveGeofences(){ + fun removeActiveGeofences() { preferences.edit().putString(PREF_KEY_SUCCESS, "[]").apply() preferences.edit().putString(PREF_KEY_FAILED, "[]").apply() } - fun getActiveGeofences(success: (success: List) -> Unit, failure: ((failed: List) -> Unit)?){ - val type = object : TypeToken?>() {}.type + fun getActiveGeofences( + success: (success: List) -> Unit, + failure: ((failed: List) -> Unit)? + ) { + val type = object : TypeToken?>() {}.type val jsonSuccess = preferences.getString(PREF_KEY_SUCCESS, "[]") val success = gson.fromJson>(jsonSuccess, type) success(success) - if(failure != null){ + if (failure != null) { val jsonFailure = preferences.getString(PREF_KEY_FAILED, "[]") val failed = gson.fromJson>(jsonFailure, type) failure(failed) @@ -189,47 +212,74 @@ class HMG_Geofence { } - private fun checkPermission() : Boolean{ - return ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED + private fun checkPermission(): Boolean { + return ContextCompat.checkSelfPermission( + context, + Manifest.permission.ACCESS_FINE_LOCATION + ) == PackageManager.PERMISSION_GRANTED } - fun getPatientID():Int?{ + fun getPatientID(): Int? { var profileJson = preferences.getString("flutter.imei-user-data", null) if (profileJson == null) profileJson = preferences.getString("flutter.user-profile", null) val type = object : TypeToken?>() {}.type return gson.fromJson?>(profileJson, type) - ?.get("PatientID") - .toString() - .toDoubleOrNull() - ?.toInt() + ?.get("PatientID") + .toString() + .toDoubleOrNull() + ?.toInt() } - fun handleEvent(triggerGeofences: List, location: Location, transition: GeofenceTransition) { + fun handleEvent( + triggerGeofences: List, + location: Location, + transition: GeofenceTransition + ) { getPatientID()?.let { patientId -> getActiveGeofences({ activeGeofences -> triggerGeofences.forEach { geofence -> // Extract PointID from 'geofence.requestId' and find from active geofences - val pointID = activeGeofences.firstOrNull { it == geofence.requestId }?.split('_')?.first() + val pointID = + activeGeofences.firstOrNull { it == geofence.requestId }?.split('_') + ?.first() if (!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null) { val body = mutableMapOf( - "PointsID" to pointID.toIntOrNull(), - "GeoType" to transition.value, - "PatientID" to patientId + "PointsID" to pointID.toIntOrNull(), + "GeoType" to transition.value, + "PatientID" to patientId ) body.putAll(HMGUtils.defaultHTTPParams(context)) httpPost>(API.LOG_GEOFENCE, body, { response -> - saveLog(context, "HMG_GEOFENCE_NOTIFY", "Success: Notified to server\uD83D\uDE0E.") - sendNotification(context, transition.named(), geofence.requestId, "Notified to server.😎") + saveLog( + context, + "HMG_GEOFENCE_NOTIFY", + "Success: Notified to server\uD83D\uDE0E." + ) + sendNotification( + context, + transition.named(), + geofence.requestId, + "Notified to server.😎" + ) }, { exception -> val errorMessage = "${transition.named()}, ${geofence.requestId}" - saveLog(context, "HMG_GEOFENCE_NOTIFY", "failed: $errorMessage | error: ${exception.localizedMessage}") - sendNotification(context, transition.named(), geofence.requestId, "Failed to notify server😔 -> ${exception.localizedMessage}") + saveLog( + context, + "HMG_GEOFENCE_NOTIFY", + "failed: $errorMessage | error: ${exception.localizedMessage}" + ) + sendNotification( + context, + transition.named(), + geofence.requestId, + "Failed to notify server😔 -> ${exception.localizedMessage}" + ) }) } diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5fea0490..240eb6e4 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 306FE6C8271D790C002D6EFC /* OpenTokPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */; }; 306FE6CB271D8B73002D6EFC /* OpenTok.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6CA271D8B73002D6EFC /* OpenTok.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 4EE411B2E3CB5D4F81AE5078 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 762D738E274E42650063CE73 /* ring_30Sec.caf in Resources */ = {isa = PBXBuildFile; fileRef = 762D738C274E42650063CE73 /* ring_30Sec.caf */; }; 762D738F274E42650063CE73 /* ring_30Sec.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 762D738D274E42650063CE73 /* ring_30Sec.mp3 */; }; @@ -22,7 +23,6 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */; }; E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538D256AAA6500E96549 /* GlobalHelper.swift */; }; E91B5397256AAA6500E96549 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538E256AAA6500E96549 /* Extensions.swift */; }; E91B5398256AAA6500E96549 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538F256AAA6500E96549 /* API.swift */; }; @@ -63,6 +63,8 @@ 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokPlatformBridge.swift; sourceTree = ""; }; 306FE6CA271D8B73002D6EFC /* OpenTok.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTok.swift; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6EE8819867EC2775AB578377 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 762D738C274E42650063CE73 /* ring_30Sec.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring_30Sec.caf; path = ../../assets/sounds/ring_30Sec.caf; sourceTree = ""; }; @@ -70,9 +72,8 @@ 76815B26275F381C00E66E94 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 76F2556027F1FFED0062C1CD /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; }; - 7805E271E86E72F39E68ADCC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 838788A2BEDC4910F4B029A6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -80,7 +81,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BC1BA79F1F6E9D7BE59D2AE4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; E91B538D256AAA6500E96549 /* GlobalHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalHelper.swift; sourceTree = ""; }; E91B538E256AAA6500E96549 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; E91B538F256AAA6500E96549 /* API.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; @@ -99,7 +99,7 @@ E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = ""; }; E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = ""; }; - EBA301C32F4CA9F09D2D7713 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + F2C7D3C4718A1DED85DA3AD4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -110,7 +110,7 @@ 76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */, 76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */, E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */, - B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */, + 4EE411B2E3CB5D4F81AE5078 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -133,7 +133,7 @@ 76F2556027F1FFED0062C1CD /* PassKit.framework */, 76815B26275F381C00E66E94 /* HealthKit.framework */, E9620804255C2ED100D3A35D /* NetworkExtension.framework */, - 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */, + 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -141,9 +141,9 @@ 605039E5DDF72C245F9765FE /* Pods */ = { isa = PBXGroup; children = ( - EBA301C32F4CA9F09D2D7713 /* Pods-Runner.debug.xcconfig */, - 7805E271E86E72F39E68ADCC /* Pods-Runner.release.xcconfig */, - BC1BA79F1F6E9D7BE59D2AE4 /* Pods-Runner.profile.xcconfig */, + F2C7D3C4718A1DED85DA3AD4 /* Pods-Runner.debug.xcconfig */, + 838788A2BEDC4910F4B029A6 /* Pods-Runner.release.xcconfig */, + 6EE8819867EC2775AB578377 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -246,15 +246,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */, + 6D0B2FE51DC05E2D0395E861 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */, - 541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */, + 487FDD6493EB9AE7D8E39485 /* [CP] Embed Pods Frameworks */, + 4671D3CD126F6635F4B75A6E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -334,7 +334,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; }; - 541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */ = { + 4671D3CD126F6635F4B75A6E /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -351,21 +351,24 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + 487FDD6493EB9AE7D8E39485 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Run Script"; - outputPaths = ( + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */ = { + 6D0B2FE51DC05E2D0395E861 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -387,22 +390,19 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + inputPaths = ( ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + name = "Run Script"; + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; /* End PBXShellScriptBuildPhase section */ @@ -538,7 +538,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.57; + MARKETING_VERSION = 4.5.63; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -682,7 +682,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.57; + MARKETING_VERSION = 4.5.63; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -720,7 +720,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.57; + MARKETING_VERSION = 4.5.63; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/pubspec.yaml b/pubspec.yaml index 834913a8..ff3d9a2f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.63+1 +version: 4.5.020+4050020 environment: sdk: ">=2.7.0 <3.0.0" From badc13d41a148b7d21d13e6b9e4e09b130b3ca43 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 May 2023 10:39:20 +0300 Subject: [PATCH 11/12] sickleave CR Enabled --- lib/config/config.dart | 2 +- .../medical/patient_sick_leave_page.dart | 25 ++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index cd192911..0694f080 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -323,7 +323,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.4; +var VERSION_ID = 10.5; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 1ca32e02..3d977a96 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - // isSickLeave: true, - // sickLeaveStatus: model.sickLeaveList[index].status, + isSickLeave: true, + sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - // if (model.sickLeaveList[index].status == 1) { - // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - // } else if (model.sickLeaveList[index].status == 2) { + if (model.sickLeaveList[index].status == 1) { + openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - // } else { - // showApprovalDialog(); - // } + } else { + showApprovalDialog(); + } } void showApprovalDialog() { @@ -111,7 +111,14 @@ class _PatientSickLeavePageState extends State { } void openWorkPlaceUpdatePage(int requestNumber, String setupID, PatientSickLeaveViewMode model, int index, int projectID) { - Navigator.push(context, FadePage(page: WorkplaceUpdatePage(requestNumber: requestNumber, setupID: setupID, projectID: projectID,))).then((value) { + Navigator.push( + context, + FadePage( + page: WorkplaceUpdatePage( + requestNumber: requestNumber, + setupID: setupID, + projectID: projectID, + ))).then((value) { print(value); if (value != null && value == true) { model.getSickLeave(); From 15c4f016dfd8a1913cc2b71f388bc847e27a7b5b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 May 2023 12:48:42 +0300 Subject: [PATCH 12/12] update to stores for version 10.5 --- lib/pages/BookAppointment/SearchResults.dart | 1 + pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 0f80abac..3d95a694 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -52,6 +52,7 @@ class _SearchResultsState extends State { ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, isTitleSingleLine: false, + isExpand: widget.patientDoctorAppointmentListHospital.length == 1 ? true : false, bodyWidget: ListView.separated( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), diff --git a/pubspec.yaml b/pubspec.yaml index ff3d9a2f..39370e58 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.020+4050020 +version: 4.5.64+1 environment: sdk: ">=2.7.0 <3.0.0"