From 5fb92c78160ee33feca9117c574b6debf2c8537f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 3 Mar 2021 18:21:13 +0300 Subject: [PATCH 01/39] covid drive-thru --- lib/pages/Covid-DriveThru/covid-payment-details.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index e6c87d0a..edf5e612 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -144,7 +144,7 @@ class _CovidPaymentDetailsState extends State { isAgree = !isAgree; }); }, - activeColor: Colors.blue, + activeColor: Color(0xffB8382C), ), Texts(TranslationBase.of(context) .iAgreeToTheTermsAndConditions), From 12c42506549772e0b8de4e574986acbb60362cbf Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 11 Mar 2021 13:04:46 +0300 Subject: [PATCH 02/39] home page ereferral fix --- lib/pages/landing/home_page.dart | 64 +++++++++++++++++--------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index c2f96194..11bc0c95 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; @@ -624,38 +625,41 @@ class _HomePageState extends State { color: Colors.white, ), ), - Container( - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/ereferral_service_icon.png', - width: 50, - height: 55, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context) - .offersAndPackages, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, - ) - ], + InkWell( + onTap: () => Navigator.push(context, FadePage(page: EReferralPage())), + child: Container( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/ereferral_service_icon.png', + width: 50, + height: 55, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context) + .offersAndPackages, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], + ), ), ), - ), - width: MediaQuery.of(context).size.width * 0.29, - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - )), + width: MediaQuery.of(context).size.width * 0.29, + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + )), + ), if (projectViewModel.havePrivilege(60)) Container( width: MediaQuery.of(context).size.width * 0.29, From accc39d972bbdf202aac07e8dfdb63892bb96263 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 16 Mar 2021 11:45:58 +0300 Subject: [PATCH 03/39] jira bug fixes --- lib/config/config.dart | 8 ++--- lib/config/localized_values.dart | 2 +- .../service/feedback/feedback_service.dart | 5 +-- .../widgets/AppointmentCardView.dart | 2 +- lib/pages/feedback/send_feedback_page.dart | 2 +- .../medical/ask_doctor/request_type.dart | 3 +- .../medical/balance/my_balance_page.dart | 5 ++- .../pharmacyAddress_service.dart | 2 +- lib/uitl/date_uitl.dart | 33 ++++++++++++++++--- 9 files changed, 43 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f8df420..d5e7054a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -14,12 +14,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs -// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; -// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // Pharmacy Production URLs -const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4cababb4..c8fcb5ca 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1078,7 +1078,7 @@ const Map localizedValues = { }, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, - "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, + "ResendOrder": {"en": "Refill Order & Delivery", "ar": "إعادة طلب و توصيل"}, "Ports": {"en": "Ports", "ar": "المنافذ"}, "Way": {"en": "Way", "ar": "الطزيقة"}, "Average": {"en": "Average", "ar": "المعدل"}, diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index 9df5b0a6..9355daf0 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; class FeedbackService extends BaseService { List cOCItemList = List(); @@ -26,7 +27,7 @@ class FeedbackService extends BaseService { _requestInsertCOCItem.details = details; _requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName; - _requestInsertCOCItem.mobileNo = user.mobileNumber; + _requestInsertCOCItem.mobileNo = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); _requestInsertCOCItem.isUserLoggedIn = true; _requestInsertCOCItem.projectID = user.projectID; _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; @@ -64,7 +65,7 @@ class FeedbackService extends BaseService { hasError = false; Map body = new Map(); body['IdentificationNo'] = user.patientIdentificationNo; - body['MobileNo'] = user.mobileNumber; + body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); body['Searching_type'] = '1'; await baseAppClient.post(GET_STATUS_FOR_COCO, diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 51e18ff4..31a7cb2d 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -195,7 +195,7 @@ class _ApointmentCardState extends State { widgetBuilder: (_, CurrentRemainingTime time) { return time != null ? Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours : "0"}:${time.min}:${time.sec} ' + TranslationBase.of(context) .upcomingTimeLeft, style: TextStyle( diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index aded1a3b..3dda95f9 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -418,7 +418,7 @@ class _SendFeedbackPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.09, + height: 80.0, width: double.infinity, padding: EdgeInsets.all(15.0), child: Center( diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index 55e04a73..eaf2913d 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -104,7 +104,8 @@ class _RequestTypePageState extends State { ), bottomSheet: Container( width: double.maxFinite, - height: MediaQuery.of(context).size.height * 0.1, + // height: MediaQuery.of(context).size.height * 0.1, + height: 80.0, child: Padding( padding: const EdgeInsets.all(12.0), child: SecondaryButton( diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 8f80eeeb..b9cd6b53 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'advance_payment_page.dart'; @@ -105,12 +104,12 @@ class MyBalancePage extends StatelessWidget { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, + // height: MediaQuery.of(context).size.height * 0.12, + height: 70.0, color: Colors.white, width: double.infinity, padding: EdgeInsets.all(12), child: SecondaryButton( - // color: Colors.grey[900], textColor: Colors.white, label: TranslationBase.of(context).createAdvancedPayment, onTap: () { diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index 592359ca..2909f18d 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -89,7 +89,7 @@ class PharmacyAddressService extends BaseService { Map body = Map(); body["customer"] = customerObject; - await baseAppClient.post("$url", onSuccess: (response, statusCode) async { + await baseAppClient.postPharmacy("$url", onSuccess: (response, statusCode) async { addresses.clear(); response['customers'][0]['addresses'].forEach((item) { addresses.add(Addresses.fromJson(item)); diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 9f959885..2ebfee2f 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -4,7 +4,8 @@ import 'package:intl/intl.dart'; class DateUtil { /// convert String To Date function /// [date] String we want to convert - static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ + static DateTime convertStringToDate(String date) { + // /Date(1585774800000+0300)/ if (date != null) { const start = "/Date("; const end = "+0300)"; @@ -241,6 +242,25 @@ class DateUtil { } } + static getWeekDayEnglish(int weekDay) { + switch (weekDay) { + case 1: + return "Monday"; + case 2: + return "Tuesday"; + case 3: + return "Wednesday"; + case 4: + return "Thursday"; + case 5: + return "Friday"; + case 6: + return "Saturday "; + case 7: + return "Sunday"; + } + } + /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted static String getMonthDayYearDateFormatted(DateTime dateTime) { @@ -253,6 +273,7 @@ class DateUtil { else return ""; } + /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted Arabic static String getMonthDayYearDateFormattedAr(DateTime dateTime) { @@ -270,9 +291,12 @@ class DateUtil { /// [dateTime] convert DateTime to date formatted static String getWeekDayMonthDayYearDateFormatted( DateTime dateTime, String lang) { + // print(dateTime); + // print(dateTime.weekday); + // print(dateTime.weekday.getDayOfWeekEnumValue.value); if (dateTime != null) return lang == 'en' - ? getDay(dateTime.weekday.getDayOfWeekEnumValue) + + ? getWeekDayEnglish(dateTime.weekday) + ", " + getMonth(dateTime.month) + " " + @@ -357,9 +381,8 @@ class DateUtil { return ""; } - static String getFormattedDate(DateTime dateTime, String formattedString){ - return DateFormat(formattedString) - .format(dateTime); + static String getFormattedDate(DateTime dateTime, String formattedString) { + return DateFormat(formattedString).format(dateTime); } static convertISODateToJsonDate(String isoDate) { From 33e1bf8103362722ec5fed2851feea6068ae6564 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 16 Mar 2021 11:53:27 +0300 Subject: [PATCH 04/39] Jira fixes --- lib/config/localized_values.dart | 10 +++++----- lib/pages/ErService/ErOptions.dart | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c8fcb5ca..80572117 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -476,11 +476,11 @@ const Map localizedValues = { "gate": {"en": "Gate:", "ar": "بوابة"}, "building": {"en": "Building:", "ar": "المبنى"}, "branch": {"en": "Branch:", "ar": "الفرع"}, - "emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, - "nearester": {"en": "Nearest ER:", "ar": "أقرب طوارى"}, - "locationa": {"en": "location:", "ar": "الموقع"}, - "ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, - "requestA": {"en": "Request:", "ar": "اسعاف"}, + "emergencyServices": {"en": "Emergency Services", "ar": "خدمات الطوارئ"}, + "nearester": {"en": "Nearest ER", "ar": "أقرب طوارى"}, + "locationa": {"en": "location", "ar": "الموقع"}, + "ambulancerequest": {"en": "Ambulance ", "ar": "طلب نقل "}, + "requestA": {"en": "Request", "ar": "اسعاف"}, "MyAppointments": {"en": "Appointments", "ar": "مواعيدي"}, "NoBookedAppointments": { "en": "No Booked Appointments", diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index e0ff3ed4..3e82b5a2 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -38,6 +38,7 @@ class _ErOptionsState extends State { return AppScaffold( isShowAppBar: widget.isAppbar, appBarTitle: TranslationBase.of(context).bookAppo, + isShowDecPage: false, body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), child: Column( From 49c454b132aa381ac000ba2a8f15347869e0ef78 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 Mar 2021 11:47:02 +0300 Subject: [PATCH 05/39] fixes --- lib/config/localized_values.dart | 1 + .../SelectTransportationMethod.dart | 2 +- lib/pages/landing/home_page.dart | 5 ++++- lib/uitl/translations_delegate_base.dart | 2 ++ lib/widgets/in_app_browser/InAppBrowser.dart | 20 +++++++++---------- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 262a592d..c3544984 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1215,6 +1215,7 @@ const Map localizedValues = { "ar": "حدد طريقة النقل" }, "RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"}, + "RRT-way-heading": {"en": "Select Way", "ar": "حدد الطريق"}, "to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"}, "from-hospital": {"en": "From Hospital", "ar": "من المستشفى"}, "one-direc": {"en": "One Way", "ar": "ذهاب"}, diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 0770448e..bf44d94c 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -206,7 +206,7 @@ class _SelectTransportationMethodState SizedBox( height: 8, ), - Texts(TranslationBase.of(context).directionHeading), + Texts(TranslationBase.of(context).wayHeading), SizedBox( height: 5, ), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 11bc0c95..b682021a 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -99,6 +99,7 @@ class _HomePageState extends State { Texts( TranslationBase.of(context) .covidTest, + fontSize: 15.0, color: Colors.white, fontWeight: FontWeight.w700, ), @@ -127,6 +128,7 @@ class _HomePageState extends State { .driveThru, fontWeight: FontWeight.w700, + fontSize: 15.0, color: Colors.white, ), ButtonTheme( @@ -141,7 +143,7 @@ class _HomePageState extends State { context) .size .width * - 0.15, + 0.14, height: 25.0, child: RaisedButton( color: Colors @@ -163,6 +165,7 @@ class _HomePageState extends State { fontWeight: FontWeight .w700, + fontSize: 14.0, color: Colors .white, ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index a90f8614..115e8319 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1115,6 +1115,8 @@ class TranslationBase { localizedValues['RRT-transport-heading'][locale.languageCode]; String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode]; + String get wayHeading => + localizedValues['RRT-way-heading'][locale.languageCode]; String get toHospital => localizedValues['to-hospital'][locale.languageCode]; String get fromHospital => localizedValues['from-hospital'][locale.languageCode]; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index df535eba..8431fd74 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -9,23 +9,23 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; class MyInAppBrowser extends InAppBrowser { - // 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 + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + // static String PREAUTH_SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live + 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + + // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = + // 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live static List successURLS = [ 'success', From a6a9a92c6f4a98f9b88453fe87e1ad41a1e1db55 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 Mar 2021 12:41:08 +0300 Subject: [PATCH 06/39] JIRA bug fixes --- .../covid-drivethru-location.dart | 281 ++++++++++++------ lib/pages/ErService/NearestEr.dart | 1 + lib/widgets/buttons/secondary_button.dart | 2 +- lib/widgets/in_app_browser/InAppBrowser.dart | 20 +- 4 files changed, 202 insertions(+), 102 deletions(-) diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index a8cb5048..749d9140 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; @@ -29,23 +30,33 @@ class _CovidDrivethruLocationState extends State { ProjectViewModel projectViewModel; + List imagesInfo = List(); + @override void initState() { - WidgetsBinding.instance - .addPostFrameCallback((_) => getProjectsList(context)); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (projectViewModel.isLogin) getProjectsList(context); + }); super.initState(); } @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png')); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, + isShowDecPage: true, + description: TranslationBase.of(context).covidInfo, + imagesInfo: imagesInfo, body: SingleChildScrollView( child: Container( margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), child: Column( + mainAxisSize: MainAxisSize.max, children: [ Container( alignment: projectViewModel.isArabic @@ -136,96 +147,185 @@ class _CovidDrivethruLocationState extends State { this.projectLong + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), ) - : Container(), - ], - ), - ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.15, - width: double.infinity, - child: Column( - children: [ - Container( - margin: EdgeInsets.only(top: 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.91, - height: 45.0, - child: RaisedButton( - color: new Color(0xFFc5272d), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: Colors.red[300], - onPressed: () { - getDirections(); - }, - child: Text(TranslationBase.of(context).getDirections, - style: TextStyle(fontSize: 18.0)), - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + : SizedBox( + height: MediaQuery.of(context).size.height * 0.35, + ), + Container( + height: MediaQuery.of(context).size.height * 0.15, + width: double.infinity, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), child: ButtonTheme( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.91, height: 45.0, child: RaisedButton( - color: new Color(0xFF60686b), + color: new Color(0xFFc5272d), textColor: Colors.white, disabledTextColor: Colors.white, - disabledColor: Colors.grey[500], + disabledColor: Colors.red[300], onPressed: () { - back(); + getDirections(); }, - child: Text(TranslationBase.of(context).back, + child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)), ), ), ), - ), - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: Colors.grey[500], - onPressed: () { - next(); - }, - child: Text(TranslationBase.of(context).next, - style: TextStyle(fontSize: 18.0)), - ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + back(); + }, + child: Text(TranslationBase.of(context).back, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: + MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + next(); + }, + child: Text(TranslationBase.of(context).next, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), + // bottomSheet: Container( + // height: MediaQuery.of(context).size.height * 0.15, + // width: double.infinity, + // child: Column( + // children: [ + // Container( + // margin: EdgeInsets.only(top: 10.0), + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // minWidth: MediaQuery.of(context).size.width * 0.91, + // height: 45.0, + // child: RaisedButton( + // color: new Color(0xFFc5272d), + // textColor: Colors.white, + // disabledTextColor: Colors.white, + // disabledColor: Colors.red[300], + // onPressed: () { + // getDirections(); + // }, + // child: Text(TranslationBase.of(context).getDirections, + // style: TextStyle(fontSize: 18.0)), + // ), + // ), + // ), + // Container( + // margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), + // child: Flex( + // direction: Axis.horizontal, + // children: [ + // Expanded( + // flex: 1, + // child: Container( + // margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // minWidth: MediaQuery.of(context).size.width * 0.7, + // height: 45.0, + // child: RaisedButton( + // color: new Color(0xFF60686b), + // textColor: Colors.white, + // disabledTextColor: Colors.white, + // disabledColor: Colors.grey[500], + // onPressed: () { + // back(); + // }, + // child: Text(TranslationBase.of(context).back, + // style: TextStyle(fontSize: 18.0)), + // ), + // ), + // ), + // ), + // Expanded( + // flex: 1, + // child: Container( + // margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // minWidth: MediaQuery.of(context).size.width * 0.7, + // height: 45.0, + // child: RaisedButton( + // color: new Color(0xFF60686b), + // textColor: Colors.white, + // disabledTextColor: Colors.white, + // disabledColor: Colors.grey[500], + // onPressed: () { + // next(); + // }, + // child: Text(TranslationBase.of(context).next, + // style: TextStyle(fontSize: 18.0)), + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), ); } @@ -277,25 +377,24 @@ class _CovidDrivethruLocationState extends State { service .getCovidPaymentInformation(context, int.parse(projectID)) .then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - setState(() { - covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( - res['COVID19_PatientShare']); - print(covidPaymentInfoResponse.procedureNameField); - }); - Navigator.push( - context, - FadePage( - page: CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - ))); - } else {} - }) - .catchError((err) { - print(err); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + covidPaymentInfoResponse = + CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); }); + Navigator.push( + context, + FadePage( + page: CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); + } else {} + }).catchError((err) { + print(err); + }); } getProjectsList(BuildContext context) { diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index eaf0d4ef..cbafacce 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -31,6 +31,7 @@ class NearestEr extends StatelessWidget { : (model) => model.getProjectAvgERWaitingTimeOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, + isShowDecPage: false, appBarTitle: TranslationBase.of(context).NearestEr, baseViewModel: mode, body: mode.ProjectAvgERWaitingTimeModeList.length > 0 diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index b5a4655a..8c4ba851 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -241,7 +241,7 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: widget.small ? 12.0 : 15.0, + fontSize: widget.small ? 12.0 : 14.0, // fontWeight: FontWeight.w800, fontFamily: projectViewModel.isArabic ? 'Cairo' diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index ca9897ab..7bf31216 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -21,23 +21,23 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; - // 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 + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + // static String PREAUTH_SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live + 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + + // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = + // 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live // Packages static String PACKAGES_REQUEST_PAYMENT_URL = '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1'; From 353a5157f28af9ea120e0147d6d687027f901182 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 29 Mar 2021 14:44:20 +0300 Subject: [PATCH 07/39] fixes --- lib/config/localized_values.dart | 1 + lib/pages/feedback/send_feedback_page.dart | 2 +- lib/pages/landing/home_page.dart | 2 +- lib/uitl/translations_delegate_base.dart | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 59f2bfcc..32e0fef2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1124,6 +1124,7 @@ const Map localizedValues = { }, "question": {"en": "Question", "ar": "سؤال"}, "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, + "feedback-type": {"en": "Feedback Type", "ar": "نوع الرسالة"}, "compliment": {"en": "compliment", "ar": "ثناء"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, "your-feedback": { diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 3dda95f9..3b4bb827 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -544,7 +544,7 @@ class FeedbackTypeDialogState extends State { return BaseView( builder: (_, model, widge) => SimpleDialog( title: Text( - TranslationBase.of(context).messageType, + TranslationBase.of(context).feedbackType, textAlign: TextAlign.center, ), children: [ diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 8edff20f..72bcece4 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -798,7 +798,7 @@ class _HomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).contactUs, + TranslationBase.of(context).reachUs, color: Colors.white, fontWeight: FontWeight.normal, ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index c17a75fe..bc29bfc2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1607,6 +1607,8 @@ class TranslationBase { String get insuranceID => localizedValues["insurance-id"][locale.languageCode]; String get enterFile => localizedValues["enter-file"][locale.languageCode]; + String get feedbackType => localizedValues["feedback-type"][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { From f310f9d0abc8fcc6fd0f2f89ca1231a5ca2405f7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 15 Jul 2021 11:01:09 +0300 Subject: [PATCH 08/39] config --- lib/config/config.dart | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a2640d90..013f1772 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,20 +13,16 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -<<<<<<< HEAD -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -======= -//const BASE_URL = 'https://uat.hmgwebservices.com/'; ->>>>>>> bcb4f487854a894a41a6578a08e0e8f306120033 -const BASE_URL = 'https://hmgwebservices.com/'; + const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs -//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; //const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // Pharmacy Production URLs -const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +//const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +//const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; From 4504b4bf751f91be716a6a6ee21e0d56c9cbc1cf Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 15 Jul 2021 11:02:45 +0300 Subject: [PATCH 09/39] config --- lib/config/config.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 013f1772..e52be1a1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -18,7 +18,7 @@ const PACKAGES_ORDERS = '/api/orders'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; -//const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // Pharmacy Production URLs //const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; From 213d104d57b2121a89a2e5ff7258eb45688d7136 Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Sun, 1 Aug 2021 10:32:17 +0300 Subject: [PATCH 10/39] Covid test procedure selection implemented --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 6 +- .../CovidTestProceduresResponse.dart | 32 +++++ .../Covid-DriveThru/Covid-TimeSlots.dart | 22 +-- .../covid-drivethru-location.dart | 127 +++++------------- .../covid-payment-details.dart | 113 +++++++++++++++- lib/pages/landing/home_page.dart | 6 +- .../appointment_services/GetDoctorsList.dart | 3 +- .../covid-drivethru/covid-drivethru.dart | 39 +++++- lib/uitl/translations_delegate_base.dart | 4 +- 10 files changed, 240 insertions(+), 115 deletions(-) create mode 100644 lib/models/CovidDriveThru/CovidTestProceduresResponse.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 40e0a300..62fedb16 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -370,6 +370,9 @@ const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; +const GET_COVID_DRIVETHRU_PROCEDURES_LIST = + 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; + const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 534c0cc6..f1ad075f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2019,5 +2019,9 @@ const Map localizedValues = { "ar": "علاقة الطالب" }, "newReferral": {"en": "New Referral", "ar": "إحالة جديدة"}, - "searchForReferrals": {"en": "Search For Referrals", "ar": "ابحث عن الإحالات"} + "searchForReferrals": {"en": "Search For Referrals", "ar": "ابحث عن الإحالات"}, + "covid-select-procedure": { + "en": "Please select the procedure:", + "ar": "الرجاء تحديد الإجراء:" + } }; diff --git a/lib/models/CovidDriveThru/CovidTestProceduresResponse.dart b/lib/models/CovidDriveThru/CovidTestProceduresResponse.dart new file mode 100644 index 00000000..c104a1fc --- /dev/null +++ b/lib/models/CovidDriveThru/CovidTestProceduresResponse.dart @@ -0,0 +1,32 @@ +class CovidTestProceduresResponse { + String procedureID; + String procedureName; + String procedureNameN; + int projectID; + String setupID; + + CovidTestProceduresResponse( + {this.procedureID, + this.procedureName, + this.procedureNameN, + this.projectID, + this.setupID}); + + CovidTestProceduresResponse.fromJson(Map json) { + procedureID = json['ProcedureID']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProcedureID'] = this.procedureID; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + return data; + } +} diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 04a7178f..c12dd877 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; @@ -27,6 +28,7 @@ class CovidTimeSlots extends StatefulWidget { static DateTime selectedAppoDateTime; static String selectedDate; static String selectedTime; + CovidTestProceduresResponse selectedProcedure; int selectedClinicID; int selectedDoctorID; @@ -35,7 +37,7 @@ class CovidTimeSlots extends StatefulWidget { PatientShareResponse patientShareResponse; - CovidTimeSlots({@required this.projectID}); + CovidTimeSlots({@required this.projectID, @required this.selectedProcedure}); @override _CovidTimeSlotsState createState() => _CovidTimeSlotsState(); @@ -94,10 +96,12 @@ class _CovidTimeSlotsState extends State super.dispose(); } - void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) { + void _onDaySelected( + DateTime day, List events, ProjectViewModel projectViewModel) { final DateFormat formatter = DateFormat('yyyy-MM-dd'); setState(() { - this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en"); + this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted( + day, projectViewModel.isArabic ? "ar" : "en"); openTimeSlotsPickerForDate(day, docFreeSlots); CovidTimeSlots.selectedDate = formatter.format(day); print(CovidTimeSlots.selectedDate); @@ -260,7 +264,8 @@ class _CovidTimeSlotsState extends State onPressed: () { bookCovidTestAppointment(); }, - child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 18.0)), ), ), ), @@ -355,11 +360,7 @@ class _CovidTimeSlotsState extends State }, ), onDaySelected: (date, event, _) { - _onDaySelected( - date, - event, - projectViewModel - ); + _onDaySelected(date, event, projectViewModel); _animationController.forward(from: 0.0); }, onVisibleDaysChanged: _onVisibleDaysChanged, @@ -494,7 +495,8 @@ class _CovidTimeSlotsState extends State docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, - context) + context, + widget.selectedProcedure.procedureID) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 749d9140..9bccd300 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; @@ -22,6 +23,7 @@ class CovidDrivethruLocation extends StatefulWidget { class _CovidDrivethruLocationState extends State { String projectDropdownValue; List projectsList = []; + List proceduresList = []; bool isLocationSelected = false; String projectLat = ""; String projectLong = ""; @@ -35,7 +37,10 @@ class _CovidDrivethruLocationState extends State { @override void initState() { WidgetsBinding.instance.addPostFrameCallback((_) { - if (projectViewModel.isLogin) getProjectsList(context); + if (projectViewModel.isLogin) { + getProjectsList(context); + getTestProcedures(context); + } }); super.initState(); } @@ -241,91 +246,6 @@ class _CovidDrivethruLocationState extends State { ), ), ), - // bottomSheet: Container( - // height: MediaQuery.of(context).size.height * 0.15, - // width: double.infinity, - // child: Column( - // children: [ - // Container( - // margin: EdgeInsets.only(top: 10.0), - // child: ButtonTheme( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10.0), - // ), - // minWidth: MediaQuery.of(context).size.width * 0.91, - // height: 45.0, - // child: RaisedButton( - // color: new Color(0xFFc5272d), - // textColor: Colors.white, - // disabledTextColor: Colors.white, - // disabledColor: Colors.red[300], - // onPressed: () { - // getDirections(); - // }, - // child: Text(TranslationBase.of(context).getDirections, - // style: TextStyle(fontSize: 18.0)), - // ), - // ), - // ), - // Container( - // margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), - // child: Flex( - // direction: Axis.horizontal, - // children: [ - // Expanded( - // flex: 1, - // child: Container( - // margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), - // child: ButtonTheme( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10.0), - // ), - // minWidth: MediaQuery.of(context).size.width * 0.7, - // height: 45.0, - // child: RaisedButton( - // color: new Color(0xFF60686b), - // textColor: Colors.white, - // disabledTextColor: Colors.white, - // disabledColor: Colors.grey[500], - // onPressed: () { - // back(); - // }, - // child: Text(TranslationBase.of(context).back, - // style: TextStyle(fontSize: 18.0)), - // ), - // ), - // ), - // ), - // Expanded( - // flex: 1, - // child: Container( - // margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), - // child: ButtonTheme( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10.0), - // ), - // minWidth: MediaQuery.of(context).size.width * 0.7, - // height: 45.0, - // child: RaisedButton( - // color: new Color(0xFF60686b), - // textColor: Colors.white, - // disabledTextColor: Colors.white, - // disabledColor: Colors.grey[500], - // onPressed: () { - // next(); - // }, - // child: Text(TranslationBase.of(context).next, - // style: TextStyle(fontSize: 18.0)), - // ), - // ), - // ), - // ), - // ], - // ), - // ), - // ], - // ), - // ), ); } @@ -368,21 +288,18 @@ class _CovidDrivethruLocationState extends State { getPaymentInfo(BuildContext context, String projectID) { CovidDriveThruService service = new CovidDriveThruService(); - CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); - GifLoaderDialogUtils.showMyDialog(context); - service - .getCovidPaymentInformation(context, int.parse(projectID)) + .getCovidPaymentInformation( + context, int.parse(projectID), proceduresList[0].procedureID) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); - print(covidPaymentInfoResponse.procedureNameField); }); Navigator.push( context, @@ -390,6 +307,7 @@ class _CovidDrivethruLocationState extends State { page: CovidPaymentDetails( covidPaymentInfoResponse: covidPaymentInfoResponse, projectID: int.parse(projectID), + proceduresList: proceduresList, ))); } else {} }).catchError((err) { @@ -397,13 +315,36 @@ class _CovidDrivethruLocationState extends State { }); } + getTestProcedures(BuildContext context) { + CovidDriveThruService service = new CovidDriveThruService(); + GifLoaderDialogUtils.showMyDialog(context); + + CovidTestProceduresResponse covidTestProceduresResponse = + new CovidTestProceduresResponse(); + + service.getCovidTestProceduresList(context).then((res) { + if (res['MessageStatus'] == 1) { + print(res); + setState(() { + res['COVID19_TestProceduresList'].forEach((v) { + proceduresList.add(new CovidTestProceduresResponse.fromJson(v)); + }); + }); + print(proceduresList.length); + print(proceduresList[0].procedureName); + GifLoaderDialogUtils.hideDialog(context); + } else {} + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + getProjectsList(BuildContext context) { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); service.getCovidProjectsList(context).then((res) { - print(res); if (res['MessageStatus'] == 1) { - print(res); setState(() { res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) { projectsList.add(new DriveThroughTestingCenterModel.fromJson(v)); diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index edf5e612..488dd3bf 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -1,5 +1,8 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; +import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -10,9 +13,13 @@ import 'package:flutter_svg/flutter_svg.dart'; class CovidPaymentDetails extends StatefulWidget { CovidPaymentInfoResponse covidPaymentInfoResponse; int projectID; + List proceduresList; + CovidTestProceduresResponse selectedProcedure; CovidPaymentDetails( - {@required this.covidPaymentInfoResponse, @required this.projectID}); + {@required this.covidPaymentInfoResponse, + @required this.projectID, + @required this.proceduresList}); @override _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); @@ -21,6 +28,13 @@ class CovidPaymentDetails extends StatefulWidget { class _CovidPaymentDetailsState extends State { bool isAgree = false; + @override + void initState() { + print(widget.proceduresList[0].procedureName); + widget.selectedProcedure = widget.proceduresList[0]; + super.initState(); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -28,7 +42,7 @@ class _CovidPaymentDetailsState extends State { isShowAppBar: true, body: SingleChildScrollView( child: Container( - margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -82,13 +96,75 @@ class _CovidPaymentDetailsState extends State { borderRadius: BorderRadius.circular(10.0), color: Colors.white), margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), - padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), + padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0), child: Column( children: [ Container( alignment: Alignment.center, margin: - EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), + EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), + child: Text( + TranslationBase.of(context).covidSelectProcedure, + style: TextStyle( + color: Colors.black, + fontSize: 20.0, + fontWeight: FontWeight.bold)), + ), + ...List.generate( + widget.proceduresList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 1, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedProcedure = + widget.proceduresList[index]; + }); + }, + child: ListTile( + title: Text( + widget.proceduresList[index] + .procedureName, + style: TextStyle(fontSize: 14.0)), + leading: Radio( + value: widget.proceduresList[index], + groupValue: widget.selectedProcedure, + activeColor: Colors.red[800], + toggleable: true, + onChanged: (value) { + setState(() { + widget.selectedProcedure = value; + print(widget + .selectedProcedure.procedureName); + getPaymentInfo( + context, + widget.projectID.toString(), + widget.selectedProcedure + .procedureID); + }); + }, + ), + ), + ), + ) + ], + ), + ], + ), + ), + Divider(), + Container( + alignment: Alignment.center, + margin: + EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), child: Text(TranslationBase.of(context).testFee, style: TextStyle( color: Colors.black, @@ -238,6 +314,7 @@ class _CovidPaymentDetailsState extends State { FadePage( page: CovidTimeSlots( projectID: widget.projectID, + selectedProcedure: widget.selectedProcedure, ))); } @@ -245,6 +322,34 @@ class _CovidPaymentDetailsState extends State { Navigator.pop(context); } + getPaymentInfo( + BuildContext context, String projectID, String selectedProcedureID) { + CovidDriveThruService service = new CovidDriveThruService(); + GifLoaderDialogUtils.showMyDialog(context); + service + .getCovidPaymentInformation( + context, int.parse(projectID), selectedProcedureID) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + widget.covidPaymentInfoResponse = + CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + }); + // Navigator.push( + // context, + // FadePage( + // page: CovidPaymentDetails( + // covidPaymentInfoResponse: covidPaymentInfoResponse, + // projectID: int.parse(projectID), + // proceduresList: proceduresList, + // ))); + } else {} + }).catchError((err) { + print(err); + }); + } + _getNormalText(text) { return Container( margin: EdgeInsets.only(top: 20.0, right: 10.0), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index cab34c08..1804e274 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -115,8 +115,8 @@ class _HomePageState extends State { ), child: SvgPicture.asset( 'assets/images/new-design/covid-19-car.svg', - width: 45.0, - height: 45.0), + width: 35.0, + height: 35.0), ), Container( margin: EdgeInsets.only( @@ -144,7 +144,7 @@ class _HomePageState extends State { context) .size .width * - 0.14, + 0.1, height: 25.0, child: RaisedButton( color: Colors diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 65fe2b04..4bb5a6ac 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -321,7 +321,7 @@ class DoctorsListService extends BaseService { } Future insertAppointment(int docID, int clinicID, int projectID, - String selectedTime, String selectedDate, BuildContext context) async { + String selectedTime, String selectedDate, BuildContext context, [String procedureID]) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -341,6 +341,7 @@ class DoctorsListService extends BaseService { "StartTime": selectedTime, "SelectedTime": selectedTime, "EndTime": selectedTime, + "ProcedureID": procedureID, "InitialSlotDuration": 0, "StrAppointmentDate": selectedDate, "IsVirtual": false, diff --git a/lib/services/covid-drivethru/covid-drivethru.dart b/lib/services/covid-drivethru/covid-drivethru.dart index 3943a8b3..35e8fb2f 100644 --- a/lib/services/covid-drivethru/covid-drivethru.dart +++ b/lib/services/covid-drivethru/covid-drivethru.dart @@ -50,7 +50,43 @@ class CovidDriveThruService extends BaseService { return Future.value(localRes); } - Future getCovidPaymentInformation(BuildContext context, int projectID) async { + Future getCovidTestProceduresList(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_PROCEDURES_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getCovidPaymentInformation(BuildContext context, int projectID, String procedureID) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -65,6 +101,7 @@ class CovidDriveThruService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "ProjectID": projectID, + "ProcedureId": procedureID, "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index fa6374ec..ce1905bc 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1632,8 +1632,8 @@ class TranslationBase { String get newReferral => localizedValues["newReferral"][locale.languageCode]; String get searchForReferrals => localizedValues["searchForReferrals"][locale.languageCode]; - - + String get covidSelectProcedure => + localizedValues["covid-select-procedure"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 9acb5b087d4bc3267b972f8d5220ab91eb914c07 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 3 Aug 2021 15:11:23 +0300 Subject: [PATCH 11/39] bug fixes --- .../new-design/liveCare_logo_icon_white.svg | 6 ++ lib/config/config.dart | 2 +- lib/config/localized_values.dart | 1 + .../service/medical/radiology_service.dart | 17 +++-- lib/pages/feedback/feedback-detail.dart | 62 +++++++++++++++ lib/pages/feedback/status_feedback_page.dart | 18 ++++- lib/pages/login/forgot-password.dart | 2 +- .../radiology/radiology_details_page.dart | 72 +++++++++--------- .../rate_appointment_clinic.dart | 17 +++-- lib/uitl/translations_delegate_base.dart | 4 + lib/uitl/utils.dart | 75 ++++++++++--------- 11 files changed, 186 insertions(+), 90 deletions(-) create mode 100644 assets/images/new-design/liveCare_logo_icon_white.svg create mode 100644 lib/pages/feedback/feedback-detail.dart diff --git a/assets/images/new-design/liveCare_logo_icon_white.svg b/assets/images/new-design/liveCare_logo_icon_white.svg new file mode 100644 index 00000000..52bce9b5 --- /dev/null +++ b/assets/images/new-design/liveCare_logo_icon_white.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/lib/config/config.dart b/lib/config/config.dart index c8df5bad..bd760fee 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -14,7 +14,7 @@ const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index eaa99a9e..c3e42ff9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2046,4 +2046,5 @@ const Map localizedValues = { "en": "Please accept terms & conditions to continue", "ar": "يرجى قبول الشروط والأحكام للمتابعة" }, + "type": {"en": "Type", "ar": "اكتب"}, }; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index b0b96e71..fceedf56 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -11,11 +11,10 @@ class RadiologyService extends BaseService { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; - body['LineIt emNo'] = lineItem; + body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.post(GET_RAD_IMAGE_URL, - isAllowAny: true, + await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { @@ -61,11 +60,15 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; _requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName; - _requestSendRadReportEmail.orderDate = '${finalRadiology.orderDate.year}-${finalRadiology.orderDate.month}-${finalRadiology.orderDate.day}'; - _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; + _requestSendRadReportEmail.orderDate = + '${finalRadiology.orderDate.year}-${finalRadiology.orderDate.month}-${finalRadiology.orderDate.day}'; + _requestSendRadReportEmail.patientIditificationNum = + user.patientIdentificationNo; _requestSendRadReportEmail.patientMobileNumber = user.mobileNumber; - _requestSendRadReportEmail.patientName = user.firstName + " " + user.lastName; - _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; + _requestSendRadReportEmail.patientName = + user.firstName + " " + user.lastName; + _requestSendRadReportEmail.patientIditificationNum = + user.patientIdentificationNo; _requestSendRadReportEmail.projectName = finalRadiology.projectName; _requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.to = user.emailAddress; diff --git a/lib/pages/feedback/feedback-detail.dart b/lib/pages/feedback/feedback-detail.dart new file mode 100644 index 00000000..6135aee9 --- /dev/null +++ b/lib/pages/feedback/feedback-detail.dart @@ -0,0 +1,62 @@ +import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; + +class FeedbackDetails extends StatelessWidget { + final COCItem items; + + FeedbackDetails({ + @required this.items, + }); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).feedbackTitle, + body: Container( + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(5), + color: Colors.white, + child: Table( + border: TableBorder.all(), + columnWidths: const { + 0: IntrinsicColumnWidth(), + 1: FlexColumnWidth(), + 2: FixedColumnWidth(64), + }, + defaultVerticalAlignment: TableCellVerticalAlignment.middle, + children: [ + TableRow( + children: [ + getColumnText(TranslationBase.of(context).feedbackTitle), + getColumnText(items.cOCTitle) + ], + ), + TableRow( + children: [ + getColumnText(TranslationBase.of(context).complaint), + getColumnText(items.cOCID) + ], + ), + TableRow( + children: [ + getColumnText(TranslationBase.of(context).date), + getColumnText(items.date) + ], + ), + TableRow( + children: [ + getColumnText(TranslationBase.of(context).type), + getColumnText(items.formType) + ], + ) + ]))); + } + + Widget getColumnText(value) { + return Container(child: Texts(value), padding: EdgeInsets.all(5)); + } +} diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 5b297e89..7541855f 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -1,11 +1,13 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -24,11 +26,16 @@ class _StatusFeedbackPageState extends State { isShowDecPage: false, body: model.cOCItemList.isNotEmpty ? Container( - margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), + margin: EdgeInsets.only( + top: 8.0, left: 8.0, right: 8.0, bottom: 80), padding: EdgeInsets.all(15.0), child: ListView.builder( itemCount: model.cOCItemList.length, - itemBuilder: (context, index) => Container( + itemBuilder: (context, index) => InkWell( + onTap: () { + gotodetails(model.cOCItemList[index]); + }, + child: Container( decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border.all(color: Colors.white, width: 0.5), @@ -87,7 +94,7 @@ class _StatusFeedbackPageState extends State { ], ), ), - )), + ))), ) : Container( child: Center( @@ -128,4 +135,9 @@ class _StatusFeedbackPageState extends State { ), ); } + + gotodetails(item) { + Navigator.pushReplacement( + context, FadePage(page: FeedbackDetails(items: item))); + } } diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index 0bc93081..a0b11cb8 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -76,7 +76,7 @@ class _ForgotPassword extends State { child: DefaultButton( TranslationBase.of(context).submit, () { - sendPatientIDBySMS(); + if (mobileNo.length >= 9) sendPatientIDBySMS(); // print(mobileNo.text); }, color: mobileNo.length >= 9 == true diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 742e3ddf..f6d12938 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -55,44 +55,46 @@ class RadiologyDetailsPage extends StatelessWidget { ), ), bottomSheet: (projectViewModel.havePrivilege(9) || - projectViewModel.havePrivilege(8)) + projectViewModel.havePrivilege(8)) ? Container( - width: double.infinity, - height: finalRadiology.dIAPACSURL != "" - ? MediaQuery.of(context).size.height * 0.25 - : MediaQuery.of(context).size.height * 0.14, - color: Colors.grey[100], - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Divider(), - if (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () { - launch(model.radImageURL); - }, - label: TranslationBase.of(context).openRad, - backgroundColor: Colors.grey[800], - ), - ), - if (projectViewModel.havePrivilege(8)) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () { - showConfirmMessage( - finalRadiology: finalRadiology, model: model); - }, - label: TranslationBase.of(context).sendCopyRad, - loading: model.state == ViewState.BusyLocal, - backgroundColor: Theme.of(context).primaryColor, + width: double.infinity, + height: finalRadiology.dIAPACSURL != "" + ? MediaQuery.of(context).size.height * 0.25 + : MediaQuery.of(context).size.height * 0.14, + color: Colors.grey[100], + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Divider(), + if (finalRadiology.dIAPACSURL != "" && + projectViewModel.havePrivilege(9)) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + label: TranslationBase.of(context).openRad, + backgroundColor: Colors.grey[800], + ), + ), + if (projectViewModel.havePrivilege(8)) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + showConfirmMessage( + finalRadiology: finalRadiology, model: model); + }, + label: TranslationBase.of(context).sendCopyRad, + loading: model.state == ViewState.BusyLocal, + backgroundColor: Theme.of(context).primaryColor, + ), + ) + ], ), ) - ], - ), - ):Container()), + : Container()), ); } diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 7fe38f1b..d1d3388f 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -1,23 +1,20 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; -import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; -import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class RateAppointmentClinic extends StatefulWidget { final AppointmentDetails appointmentDetails; @@ -108,15 +105,21 @@ class _RateAppointmentClinicState extends State { ), Texts( model.appointmentDetails.projectName, - bold: true, + fontSize: 22, + fontWeight: FontWeight.bold, ), SizedBox( height: 4, ), Texts( - model.appointmentDetails.clinicName, - bold: true, + DateUtil.getMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + model.appointmentDetails.appointmentDate)), ), + SizedBox( + height: 8, + ), + Texts(model.appointmentDetails.startTime), SizedBox( height: 8, ) diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b0840b01..5a586814 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1642,6 +1642,10 @@ class TranslationBase { localizedValues["upcoming-pay-options"][locale.languageCode]; String get pleaseAcceptTerms => localizedValues["please-accept-terms"][locale.languageCode]; +String get type => + localizedValues["type"][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 67e5c6b9..94b23b05 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -309,17 +309,17 @@ class Utils { )); } - if (projectViewModel.havePrivilege(48)) { - medical.add(InkWell( - onTap: () => - Navigator.push(context, FadePage(page: ActiveMedicationsPage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).myMedical, - imagePath: 'active_medications.png', - subTitle: TranslationBase.of(context).myMedicalSubtitle, - ), - )); - } + //if (projectViewModel.havePrivilege(48)) { + medical.add(InkWell( + onTap: () => + Navigator.push(context, FadePage(page: ActiveMedicationsPage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).myMedical, + imagePath: 'active_medications.png', + subTitle: TranslationBase.of(context).myMedicalSubtitle, + ), + )); + //} if (projectViewModel.havePrivilege(6)) { medical.add(InkWell( @@ -552,27 +552,31 @@ class Utils { return medical; } - static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}){ + static Widget loadNetworkImage( + {@required String url, BoxFit fitting = BoxFit.cover}) { return CachedNetworkImage( - placeholderFadeInDuration: Duration(milliseconds: 250), - fit: fitting, - imageUrl: url, - placeholder: (context, url) => Container( - child: Center( - child: CircularProgressIndicator() - ) - ), - errorWidget: (context, url, error){ - return Icon(Icons.error, color: Colors.red, size: 50,); - } - ); + placeholderFadeInDuration: Duration(milliseconds: 250), + fit: fitting, + imageUrl: url, + placeholder: (context, url) => + Container(child: Center(child: CircularProgressIndicator())), + errorWidget: (context, url, error) { + return Icon( + Icons.error, + color: Colors.red, + size: 50, + ); + }); } } - - - -Widget applyShadow({ Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}){ +Widget applyShadow( + {Color color = Colors.grey, + double shadowOpacity = 0.5, + double spreadRadius = 2, + double blurRadius = 7, + Offset offset = const Offset(2, 2), + @required Widget child}) { return Container( decoration: BoxDecoration( boxShadow: [ @@ -588,7 +592,6 @@ Widget applyShadow({ Color color = Colors.grey, double shadowOpacity = 0.5, doub ); } - Future userData() async { var userData = AuthenticatedUser.fromJson( await AppSharedPreferences().getObject(MAIN_USER)); @@ -603,15 +606,15 @@ extension IndexedIterable on Iterable { } } -openAppStore({String androidPackageName, String iOSAppID}) async{ - if(Platform.isAndroid){ - assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter"); - if((await FlutterHmsGmsAvailability.isGmsAvailable)) +openAppStore({String androidPackageName, String iOSAppID}) async { + if (Platform.isAndroid) { + assert(!(androidPackageName == null), + "Should have valid value in androidPackageName parameter"); + if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg"); - if((await FlutterHmsGmsAvailability.isHmsAvailable)) + if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg"); - - }else if(Platform.isIOS){ + } else if (Platform.isIOS) { assert((iOSAppID == null), "Should have valid value in iOSAppID parameter"); launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)"); } From 1ed76e91aa8c71e08ffdafbe4306ca5487747e0d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 4 Aug 2021 14:28:58 +0300 Subject: [PATCH 12/39] fixing dashboard issue --- lib/pages/landing/home_page.dart | 376 +++++++++++++++++-------------- 1 file changed, 206 insertions(+), 170 deletions(-) diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 3e51b668..b918d487 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -81,85 +81,81 @@ class _HomePageState extends State { child: Row( children: [ Expanded( - child: Visibility( - visible: model.user.outSA == 1 ? false : true, + child: Container( + height: 125, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/new-design/covid_bg_transparent.png"), + fit: BoxFit.fill, + ), + color: Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all(Radius.circular(5))), child: Container( - height: 125, - padding: EdgeInsets.all(5), - margin: EdgeInsets.all(5), - decoration: BoxDecoration( - image: DecorationImage( - image: - AssetImage("assets/images/new-design/covid_bg_transparent.png"), - fit: BoxFit.fill, + child: Column( + children: [ + Texts( + TranslationBase.of(context).covidTest, + color: Colors.white, + fontWeight: FontWeight.w700, ), - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(5))), - child: Container( - child: Column( - children: [ - Texts( - TranslationBase.of(context).covidTest, - color: Colors.white, - fontWeight: FontWeight.w700, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only( - top: 15.0, - ), - child: SvgPicture.asset( - 'assets/images/new-design/covid-19-car.svg', - width: 45.0, - height: 45.0), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0, ), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Column( - children: [ - Texts( - TranslationBase.of(context).driveThru, - fontWeight: FontWeight.w700, - color: Colors.white, + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 45.0, + height: 45.0), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Column( + children: [ + Texts( + TranslationBase.of(context).driveThru, + fontWeight: FontWeight.w700, + color: Colors.white, + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.15, - height: 25.0, - child: RaisedButton( - color: Colors.red[800], - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToCovidDriveThru(); - }, + minWidth: MediaQuery.of(context).size.width * 0.15, + height: 25.0, + child: RaisedButton( + color: Colors.red[800], + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToCovidDriveThru(); + }, + child: Center( child: Center( child: Center( child: Center( - child: Center( - child: Texts( - TranslationBase.of(context).bookNow, - fontWeight: FontWeight.w700, - color: Colors.white, - ), + child: Texts( + TranslationBase.of(context).bookNow, + fontWeight: FontWeight.w700, + color: Colors.white, ), ), ), ), ), ), - ], - ), + ), + ], ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), ), @@ -462,121 +458,161 @@ class _HomePageState extends State { if (projectViewModel.havePrivilege(64) || projectViewModel.havePrivilege(65) || projectViewModel.havePrivilege(67)) - if (model.user.outSA == 0) - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if (projectViewModel.havePrivilege(64)) - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: HomeHealthCarePage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/home_health_care_icon.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (projectViewModel.havePrivilege(64)) + DashboardItem( + onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) + ? () { + Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), ), - Texts( - TranslationBase.of(context).homeHealthCare, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ), - ), - ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'home_healthcare_service_bg.png', - opacity: 0.5, - ), - if (projectViewModel.havePrivilege(65)) - DashboardItem( - onTap: () => getPharmacyToken(model), - child: Center( - child: Padding( + ); + } + : () {}, + child: Center( + child: Padding( padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/pharmacy_logo.png', - width: 40, - height: 40, - ), - SizedBox( - height: 20, - ), - Texts( - TranslationBase.of(context).onlinePharmacy, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) + ? Column( + children: [ + Image.asset( + 'assets/images/home_health_care_icon.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).homeHealthCare, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, + ) + ], + ) + : Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + )), + ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'home_healthcare_service_bg.png', + opacity: 0.5, + ), + if (projectViewModel.havePrivilege(65)) + DashboardItem( + onTap: () => (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) + ? getPharmacyToken(model) + : () {}, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) + ? Column( + children: [ + // if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1) + // Image.asset( + // 'assets/images/lock_icon.png', + // width: 50, + // height: 50, + // ), + Image.asset( + 'assets/images/pharmacy_logo.png', + width: 40, + height: 40, + ), + SizedBox( + height: 20, + ), + Texts( + TranslationBase.of(context).onlinePharmacy, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, + ) + ], ) - ], - ), - ), + : Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ), ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'al-habib_onlne_pharmacy_bg.png', ), - if (projectViewModel.havePrivilege(67)) - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: CMCPage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/comprehensive_medical_checkup_logo.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'al-habib_onlne_pharmacy_bg.png', + ), + if (projectViewModel.havePrivilege(67)) + DashboardItem( + onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) + ? () { + Navigator.push( + context, + FadePage( + page: CMCPage(), ), - Texts( - TranslationBase.of(context).cmcHeading, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + ); + } + : () {}, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) + ? Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).cmcHeading, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, + ) + ], ) - ], - ), - ), + : Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ), ), - height: MediaQuery.of(context).size.width * 0.4, - color: HexColor("#747C80"), - imageName: 'emergency_service_image.png', ), - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + color: HexColor("#747C80"), + imageName: 'emergency_service_image.png', + ), + ], ), + ), SizedBox( height: 8, ), From 50d3a42743c0510a2d6e7e688d0df2df7e75f1a0 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 4 Aug 2021 14:53:27 +0300 Subject: [PATCH 13/39] fixing dashboard issue --- lib/pages/landing/home_page.dart | 124 +++++++++++++++---------------- 1 file changed, 61 insertions(+), 63 deletions(-) diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b918d487..3f25217c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -465,21 +465,30 @@ class _HomePageState extends State { children: [ if (projectViewModel.havePrivilege(64)) DashboardItem( - onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? () { + onTap: (model.user != null && model.user.outSA == 1) + ? () {} + : () { Navigator.push( context, FadePage( page: HomeHealthCarePage(), ), ); - } - : () {}, + }, child: Center( child: Padding( padding: const EdgeInsets.all(15.0), - child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? Column( + child: (model.user != null && model.user.outSA == 1) + ? Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) + : Column( children: [ Image.asset( 'assets/images/home_health_care_icon.png', @@ -497,15 +506,6 @@ class _HomePageState extends State { fontSize: SizeConfig.textMultiplier * 1.55, ) ], - ) - : Container( - width: double.infinity, - height: double.infinity, - color: Colors.grey.withOpacity(0.7), - child: Icon( - Icons.lock_outline, - size: 40, - ), )), ), height: MediaQuery.of(context).size.width * 0.4, @@ -514,14 +514,22 @@ class _HomePageState extends State { ), if (projectViewModel.havePrivilege(65)) DashboardItem( - onTap: () => (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? getPharmacyToken(model) - : () {}, + onTap: () => + (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model), child: Center( child: Padding( padding: const EdgeInsets.all(15.0), - child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? Column( + child: (model.user != null && model.user.outSA == 1) + ? Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) + : Column( children: [ // if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1) // Image.asset( @@ -545,15 +553,6 @@ class _HomePageState extends State { fontSize: SizeConfig.textMultiplier * 1.55, ) ], - ) - : Container( - width: double.infinity, - height: double.infinity, - color: Colors.grey.withOpacity(0.7), - child: Icon( - Icons.lock_outline, - size: 40, - ), ), ), ), @@ -562,49 +561,48 @@ class _HomePageState extends State { ), if (projectViewModel.havePrivilege(67)) DashboardItem( - onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? () { + onTap: (model.user != null && model.user.outSA == 1) + ? () {} + : () { Navigator.push( context, FadePage( page: CMCPage(), ), ); - } - : () {}, + }, child: Center( child: Padding( - padding: const EdgeInsets.all(15.0), - child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? Column( - children: [ - Image.asset( - 'assets/images/comprehensive_medical_checkup_logo.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, + padding: const EdgeInsets.all(15.0), + child: (model.user != null && model.user.outSA == 1) + ? Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, ), - Texts( - TranslationBase.of(context).cmcHeading, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ) - : Container( - width: double.infinity, - height: double.infinity, - color: Colors.grey.withOpacity(0.7), - child: Icon( - Icons.lock_outline, - size: 40, - ), - ), - ), + ) + : Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).cmcHeading, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, + ) + ], + )), ), height: MediaQuery.of(context).size.width * 0.4, color: HexColor("#747C80"), From 23ca95b9b64659539ea3c85e5481e419f10b794c Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 4 Aug 2021 17:25:49 +0300 Subject: [PATCH 14/39] bug fixes --- lib/analytics/analytic-events.dart | 87 ++-- lib/analytics/google-analytics.dart | 53 +- lib/config/localized_values.dart | 26 +- lib/core/viewModels/dashboard_view_model.dart | 7 +- .../E-Referral/e_referral_page.dart | 62 +-- .../all_habib_medical_service_page.dart | 13 +- .../covid-drivethru-location.dart | 46 +- lib/pages/landing/home_page.dart | 491 +++++++++++------- lib/pages/livecare/livecare_home.dart | 10 +- lib/pages/login/login.dart | 5 - lib/uitl/translations_delegate_base.dart | 7 +- 11 files changed, 483 insertions(+), 324 deletions(-) diff --git a/lib/analytics/analytic-events.dart b/lib/analytics/analytic-events.dart index 3e107d95..7029cad5 100644 --- a/lib/analytics/analytic-events.dart +++ b/lib/analytics/analytic-events.dart @@ -1,69 +1,72 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; -class _Event{ +class _Event { String name; String description; bool active; - _Event(dynamic map){ - name = map['name']; - description = map['description']; - active = map['active']; + _Event(dynamic map) { + if (map != null) { + name = map['name']; + description = map['description']; + active = map['active']; + } } flutterName() => 'f: $name'; } -class AnalyticEvents{ +class AnalyticEvents { static _Event get(String key) { var e = _Event(mapping[key]); - if(e == null){ - var label = labelFrom(className: key); // Convert Class Name in to Label (HomeCare -> Home Care) - e = _Event({"name": label, "active":true, "description":key}); + if (e == null) { + var label = labelFrom( + className: + key); // Convert Class Name in to Label (HomeCare -> Home Care) + e = _Event({"name": label, "active": true, "description": key}); } return e; } static var mapping = const { - "HomeHealthCarePage" : { - "active" : true, - "name" : "Home Health Care Page", - "description" : "", + "HomeHealthCarePage": { + "active": true, + "name": "Home Health Care Page", + "description": "", }, - "SplashScreen" : { - "active" : true, - "name" : "Splash Screen", - "description" : "", + "SplashScreen": { + "active": true, + "name": "Splash Screen", + "description": "", }, - "LandingPage" : { - "active" : true, - "name" : "Landing Page", - "description" : "", + "LandingPage": { + "active": true, + "name": "Landing Page", + "description": "", }, - "WelcomeLogin" : { - "active" : true, - "name" : "Welcome Login", - "description" : "", + "WelcomeLogin": { + "active": true, + "name": "Welcome Login", + "description": "", }, - "LoginType" : { - "active" : true, - "name" : "Login Type", - "description" : "", + "LoginType": { + "active": true, + "name": "Login Type", + "description": "", }, - "Login" : { - "active" : true, - "name" : "Login", - "description" : "", + "Login": { + "active": true, + "name": "Login", + "description": "", }, - "ForgotPassword" : { - "active" : true, - "name" : "Forgot Password", - "description" : "", + "ForgotPassword": { + "active": true, + "name": "Forgot Password", + "description": "", }, - "" : { - "active" : true, - "name" : "", - "description" : "", + "": { + "active": true, + "name": "", + "description": "", }, }; } - diff --git a/lib/analytics/google-analytics.dart b/lib/analytics/google-analytics.dart index f4bf8b72..0ded8cc6 100644 --- a/lib/analytics/google-analytics.dart +++ b/lib/analytics/google-analytics.dart @@ -9,28 +9,32 @@ import 'package:flutter/services.dart'; class Singleton { const Singleton(); //Constant constructor - void hello() { print('Hello world'); } + void hello() { + print('Hello world'); + } } var analytics = FirebaseAnalytics(); -class GAnalytics{ +class GAnalytics { const GAnalytics(); static GAnalytics shared = const GAnalytics(); NavObserver navObserver() => NavObserver(); } -// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android -class NavObserver extends RouteObserver>{ - - _sendScreenView(PageRoute route) async{ - - log(String className){ +// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android +class NavObserver extends RouteObserver> { + _sendScreenView(PageRoute route) async { + log(String className) { var event = AnalyticEvents.get(className); - if(event.active){ - analytics.setCurrentScreen(screenName: event.flutterName(), screenClassOverride: className).catchError( (Object error) { - debugPrint('$FirebaseAnalyticsObserver: $error'); - }, + if (event.active != null) { + analytics + .setCurrentScreen( + screenName: event.flutterName(), screenClassOverride: className) + .catchError( + (Object error) { + debugPrint('$FirebaseAnalyticsObserver: $error'); + }, test: (Object error) { return error is PlatformException; }, @@ -38,25 +42,20 @@ class NavObserver extends RouteObserver>{ } } - if(route.settings.name != null && route.settings.name.isNotEmpty && route.settings.name != "null"){ + if (route.settings.name != null && + route.settings.name.isNotEmpty && + route.settings.name != "null") { var class_ = routes[route.settings.name](0); - if(class_ != null) - log(class_.toStringShort()); - - }else if(route is FadePage){ + if (class_ != null) log(class_.toStringShort()); + } else if (route is FadePage) { var class_ = route.page; - if(class_ != null) - log(class_.toStringShort()); - - }else if(route is MaterialPageRoute){ + if (class_ != null) log(class_.toStringShort()); + } else if (route is MaterialPageRoute) { var class_ = route.builder(null); - if (class_ != null) - log(class_.toStringShort()); - - }else{ + if (class_ != null) log(class_.toStringShort()); + } else { print(""); } - } @override @@ -82,4 +81,4 @@ class NavObserver extends RouteObserver>{ // _sendScreenView(previousRoute); // } } -} \ No newline at end of file +} diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b08442d8..b0eda939 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -467,11 +467,10 @@ const Map localizedValues = { " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " }, "parkingDescription": { - - "en": "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).", - - "ar": "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)." - + "en": + "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).", + "ar": + "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)." }, "checkinOption": {"en": "Check-In Options", "ar": "تحقق في الخيارات"}, "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, @@ -1264,7 +1263,10 @@ const Map localizedValues = { "stretcher": {"en": "Stretcher", "ar": "نقالة"}, "none": {"en": "None", "ar": "لا شيء"}, "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, - "Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"}, + "Rapid-Response-Team": { + "en": "Rapid Response Team", + "ar": "فريق الاستجابة السريع" + }, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, @@ -2058,4 +2060,16 @@ const Map localizedValues = { "ar": "يرجى قبول الشروط والأحكام للمتابعة" }, "type": {"en": "Type", "ar": "اكتب"}, + "info-ereferral": { + "en": + "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", + "ar": + "تتيح لك هذه الخدمة إرسال طلب إحالة من أي من مقدمي الرعاية الصحية سواء داخل المملكة العربية السعودية أو خارجها إلى أي من مستشفيات HMG ، عن طريق ملء بعض بيانات المريض وإرفاق التقارير الطبية ، علاوة على ذلك يمكنك تتبع حالة الطلب ( قيد المعالجة ، مقبول أو مرفوض)" + }, + "er-consultation": { + "en": + "This service allows you to make an online virtual consultation via video call directly with the doctor from anywhere at any time.", + "ar": + "تتيح لك هذه الخدمة إجراء استشارة عبر مكالمة فيديو مباشرة مع الطبيب من أي مكان وفي أي وقت" + }, }; diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index e085e476..cd34fd70 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -2,8 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; + import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { @@ -13,7 +12,9 @@ class DashboardViewModel extends BaseViewModel { String get heightCm => _vitalSignService.heightCm; String booldType = "-"; - + DashboardViewModel() { + this.getPatientRadOrders(); + } // ToDoCountProviderModel toDoProvider = // Provider.of(AppGlobal.context); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index 9f4240fc..9007229a 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -2,13 +2,10 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -39,27 +36,28 @@ class _EReferralPageState extends State @override Widget build(BuildContext context) { return BaseView( - builder: (_, model, widget) => - AppScaffold( - isShowAppBar: true, - appBarTitle: "E-Referral", - description: "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", - imagesInfo: [ - ImagesInfo( - imageAr: 'assets/images/Wifi-AR.png', - imageEn: 'assets/images/wifi-EN.png', - isAsset: true) - ], - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).ereferral, + description: TranslationBase.of(context).eReferralInfo, + imagesInfo: [ + ImagesInfo( + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/ar/1.png', + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png', + ) + ], + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( @@ -97,13 +95,19 @@ class _EReferralPageState extends State Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context).newReferral, textAlign: TextAlign.center,), + child: Texts( + TranslationBase.of(context).newReferral, + textAlign: TextAlign.center, + ), ), ), Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context).searchForReferrals , textAlign: TextAlign.center,), + child: Texts( + TranslationBase.of(context).searchForReferrals, + textAlign: TextAlign.center, + ), ), ), ], @@ -121,10 +125,8 @@ class _EReferralPageState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - StartIndexForNewEReferral( - ), - SearchForReferralsPage( - ) + StartIndexForNewEReferral(), + SearchForReferralsPage() ], ), ) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 355300c4..13955612 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.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.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -157,7 +158,12 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () { Navigator.pop(context); - widget.goToMyProfile(); + Navigator.push( + context, + FadePage( + page: MedicalProfilePage(), + ), + ); }, imageLocation: 'assets/images/new-design/my_file_bottom_bar.png', @@ -254,8 +260,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage( - page: EReferralPage()), + FadePage(page: EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', title: TranslationBase.of(context).ereferral, @@ -282,7 +287,7 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).childVaccine, ), ServicesContainer( - onTap: (){ + onTap: () { Navigator.pop(context); LandingPage.shared.switchToDoFromHMGServices(); }, diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index a8cb5048..c918cae4 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -26,6 +27,7 @@ class _CovidDrivethruLocationState extends State { String projectLong = ""; String projectName = ""; String projectID = ""; + List imagesInfo = List(); ProjectViewModel projectViewModel; @@ -33,6 +35,13 @@ class _CovidDrivethruLocationState extends State { void initState() { WidgetsBinding.instance .addPostFrameCallback((_) => getProjectsList(context)); + + imagesInfo.add( + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), + ); super.initState(); } @@ -42,6 +51,8 @@ class _CovidDrivethruLocationState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).covidInfo, body: SingleChildScrollView( child: Container( margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), @@ -277,25 +288,24 @@ class _CovidDrivethruLocationState extends State { service .getCovidPaymentInformation(context, int.parse(projectID)) .then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - setState(() { - covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( - res['COVID19_PatientShare']); - print(covidPaymentInfoResponse.procedureNameField); - }); - Navigator.push( - context, - FadePage( - page: CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - ))); - } else {} - }) - .catchError((err) { - print(err); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + covidPaymentInfoResponse = + CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); }); + Navigator.push( + context, + FadePage( + page: CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); + } else {} + }).catchError((err) { + print(err); + }); } getProjectsList(BuildContext context) { diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 3e51b668..7eb17b0d 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -40,16 +40,14 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => () async { - model.getPatientRadOrders(); - var user = await sharedPref.getObject(USER_PROFILE); - }, + onModelReady: (model) => () async {}, builder: (_, model, wi) => AppScaffold( isShowDecPage: false, isHelp: true, @@ -68,7 +66,9 @@ class _HomePageState extends State { height: 210, decoration: BoxDecoration( image: DecorationImage( - image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover), + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), ), child: Stack( children: [ @@ -77,34 +77,43 @@ class _HomePageState extends State { left: 5, right: 5, child: Container( - width: MediaQuery.of(context).size.width * 0.8, + width: + MediaQuery.of(context).size.width * 0.8, child: Row( children: [ Expanded( child: Visibility( - visible: model.user.outSA == 1 ? false : true, + // visible: + // model.user.outSA == 1 + // ? false + // : true, child: Container( height: 125, padding: EdgeInsets.all(5), margin: EdgeInsets.all(5), decoration: BoxDecoration( image: DecorationImage( - image: - AssetImage("assets/images/new-design/covid_bg_transparent.png"), + image: AssetImage( + "assets/images/new-design/covid_bg_transparent.png"), fit: BoxFit.fill, ), - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(5))), + color: Colors.white + .withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), child: Container( child: Column( children: [ Texts( - TranslationBase.of(context).covidTest, + TranslationBase.of(context) + .covidTest, color: Colors.white, fontWeight: FontWeight.w700, ), Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: + MainAxisAlignment + .spaceAround, children: [ Container( margin: EdgeInsets.only( @@ -116,36 +125,64 @@ class _HomePageState extends State { height: 45.0), ), Container( - margin: EdgeInsets.only(top: 5.0), + margin: EdgeInsets.only( + top: 5.0), child: Column( children: [ Texts( - TranslationBase.of(context).driveThru, - fontWeight: FontWeight.w700, - color: Colors.white, + TranslationBase.of( + context) + .driveThru, + fontWeight: + FontWeight + .w700, + color: + Colors.white, ), ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5.0), ), - minWidth: MediaQuery.of(context).size.width * 0.15, + minWidth: MediaQuery.of( + context) + .size + .width * + 0.15, height: 25.0, - child: RaisedButton( - color: Colors.red[800], - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), + child: + RaisedButton( + color: Colors + .red[800], + textColor: + Colors + .white, + disabledTextColor: + Colors + .white, + disabledColor: + new Color( + 0xFFbcc2c4), onPressed: () { navigateToCovidDriveThru(); }, child: Center( child: Center( - child: Center( - child: Center( - child: Texts( - TranslationBase.of(context).bookNow, - fontWeight: FontWeight.w700, - color: Colors.white, + child: + Center( + child: + Center( + child: + Texts( + TranslationBase.of(context) + .bookNow, + fontWeight: + FontWeight.w700, + color: + Colors.white, ), ), ), @@ -166,14 +203,17 @@ class _HomePageState extends State { ), Expanded( child: InkWell( - onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())), + onTap: () => Navigator.push(context, + FadePage(page: LiveCareHome())), child: Container( height: 125, padding: EdgeInsets.all(15), margin: EdgeInsets.all(5), decoration: BoxDecoration( - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all(Radius.circular(5))), + color: Colors.white + .withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), child: SvgPicture.asset( projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' @@ -189,15 +229,23 @@ class _HomePageState extends State { ], ), ), - Container(width: double.infinity, height: projectViewModel.isArabic ? 110 : 80) + Container( + width: double.infinity, + height: projectViewModel.isArabic ? 110 : 80) ], ), Positioned( top: 155, left: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), right: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), child: (!model.isLogin) ? Container( width: double.infinity, @@ -205,10 +253,14 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#A59E9E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), image: DecorationImage( - image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), child: Container( margin: EdgeInsets.all(5), child: Column( @@ -224,30 +276,37 @@ class _HomePageState extends State { fontSize: 23, ), Texts( - TranslationBase.of(context).myMedicalFileSubTitle, + TranslationBase.of(context) + .myMedicalFileSubTitle, color: Colors.black, fontSize: 16, ), Align( - alignment: - projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, child: InkWell( onTap: () { widget.goToMyProfile(); }, child: Container( - margin: EdgeInsets.only(left: 15, right: 15), + margin: EdgeInsets.only( + left: 15, right: 15), width: 90, height: 30, decoration: BoxDecoration( color: HexColor('#D81A2E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(0)), + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(0)), ), child: Center( child: Texts( - TranslationBase.of(context).viewMore, + TranslationBase.of(context) + .viewMore, color: Colors.white, fontWeight: FontWeight.w700, fontSize: 12, @@ -266,10 +325,14 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#A59E9E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(9)), + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), image: DecorationImage( - image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover), + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover), ), child: Container( margin: EdgeInsets.all(5), @@ -277,51 +340,81 @@ class _HomePageState extends State { children: [ Row( children: [ - if (projectViewModel.user != null && model.isLogin) + if (projectViewModel.user != null && + model.isLogin) Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ SizedBox( height: 8, ), - model.user.cRSVerificationStatus == 2 + model.user.cRSVerificationStatus == + 2 ? Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, - color: Colors.grey[100], + model.user + .firstName + + " " + + model.user + .lastName, + color: Colors + .grey[100], bold: true, fontSize: 15, ), Container( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), + margin: EdgeInsets + .fromLTRB( + 8.0, + 0.0, + 8.0, + 0.0), child: SvgPicture.asset( "assets/images/new-design/verification_check.svg"), ), ], ) - : model.user.cRSVerificationStatus == 3 + : model.user.cRSVerificationStatus == + 3 ? Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, - color: Colors.grey[100], + model.user + .firstName + + " " + + model.user + .lastName, + color: Colors + .grey[100], bold: true, fontSize: 15, ), Container( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), - child: SvgPicture.asset( - "assets/images/new-design/pending.svg"), + margin: EdgeInsets + .fromLTRB( + 8.0, + 0.0, + 8.0, + 0.0), + child: SvgPicture + .asset( + "assets/images/new-design/pending.svg"), ), ], ) : Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, - color: Colors.grey[100], + model.user + .firstName + + " " + + model.user + .lastName, + color: Colors + .grey[100], bold: true, fontSize: 15, ), @@ -355,14 +448,17 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#D81A2E'), shape: BoxShape.rectangle, - border: Border.all(color: Colors.transparent, width: 0.5), + border: Border.all( + color: Colors.transparent, + width: 0.5), borderRadius: BorderRadius.all( Radius.circular(5), ), ), child: Center( child: Texts( - TranslationBase.of(context).myMedicalFile, + TranslationBase.of(context) + .myMedicalFile, color: Colors.white, fontSize: 12, textAlign: TextAlign.center, @@ -401,8 +497,10 @@ class _HomePageState extends State { width: 25, height: 40, ), - Texts('${model.weightKg} ${TranslationBase.of(context).kg}', - color: Colors.white, fontSize: 17) + Texts( + '${model.weightKg} ${TranslationBase.of(context).kg}', + color: Colors.white, + fontSize: 17) ], ), ), @@ -417,7 +515,9 @@ class _HomePageState extends State { width: 35, height: 40, ), - Texts('${model.booldType}', color: Colors.white, fontSize: 17) + Texts('${model.booldType}', + color: Colors.white, + fontSize: 17) ], ), ), @@ -431,10 +531,12 @@ class _HomePageState extends State { ], ), Padding( - padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15), + padding: + const EdgeInsets.only(bottom: 15, right: 15, left: 15), child: InkWell( onTap: () { - Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage())); + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PackagesHomePage())); }, child: Container( decoration: BoxDecoration( @@ -462,126 +564,132 @@ class _HomePageState extends State { if (projectViewModel.havePrivilege(64) || projectViewModel.havePrivilege(65) || projectViewModel.havePrivilege(67)) - if (model.user.outSA == 0) - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if (projectViewModel.havePrivilege(64)) - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: HomeHealthCarePage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/home_health_care_icon.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).homeHealthCare, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ), + // if (model.user.outSA == 0) + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (projectViewModel.havePrivilege(64)) + DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), + ), + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/home_health_care_icon.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context) + .homeHealthCare, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: + SizeConfig.textMultiplier * 1.55, + ) + ], ), ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'home_healthcare_service_bg.png', - opacity: 0.5, ), - if (projectViewModel.havePrivilege(65)) - DashboardItem( - onTap: () => getPharmacyToken(model), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/pharmacy_logo.png', - width: 40, - height: 40, - ), - SizedBox( - height: 20, - ), - Texts( - TranslationBase.of(context).onlinePharmacy, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'home_healthcare_service_bg.png', + opacity: 0.5, + ), + if (projectViewModel.havePrivilege(65)) + DashboardItem( + onTap: () => getPharmacyToken(model), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/pharmacy_logo.png', + width: 40, + height: 40, + ), + SizedBox( + height: 20, + ), + Texts( + TranslationBase.of(context) + .onlinePharmacy, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: + SizeConfig.textMultiplier * 1.55, + ) + ], ), ), - height: MediaQuery.of(context).size.width * 0.4, - imageName: 'al-habib_onlne_pharmacy_bg.png', ), - if (projectViewModel.havePrivilege(67)) - DashboardItem( - onTap: () { - Navigator.push( - context, - FadePage( - page: CMCPage(), - ), - ); - }, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/comprehensive_medical_checkup_logo.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).cmcHeading, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + imageName: 'al-habib_onlne_pharmacy_bg.png', + ), + if (projectViewModel.havePrivilege(67)) + DashboardItem( + onTap: () { + Navigator.push( + context, + FadePage( + page: CMCPage(), + ), + ); + }, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).cmcHeading, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: + SizeConfig.textMultiplier * 1.55, + ) + ], ), ), - height: MediaQuery.of(context).size.width * 0.4, - color: HexColor("#747C80"), - imageName: 'emergency_service_image.png', ), - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + color: HexColor("#747C80"), + imageName: 'emergency_service_image.png', + ), + ], ), + ), SizedBox( height: 8, ), InkWell( - onTap: () => Navigator.push(context, FadePage(page: PaymentService())), + onTap: () => + Navigator.push(context, FadePage(page: PaymentService())), child: Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( @@ -602,7 +710,8 @@ class _HomePageState extends State { height: 5, ), Texts( - TranslationBase.of(context).onlinePaymentService, + TranslationBase.of(context) + .onlinePaymentService, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -633,7 +742,8 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).offersAndPackages, + TranslationBase.of(context) + .offersAndPackages, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -673,11 +783,13 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).emergencyServices, + TranslationBase.of(context) + .emergencyServices, textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: + SizeConfig.textMultiplier * 1.7, ) ], ), @@ -715,7 +827,8 @@ class _HomePageState extends State { fontWeight: FontWeight.normal, ), Texts( - TranslationBase.of(context).viewAllHabibMedicalService, + TranslationBase.of(context) + .viewAllHabibMedicalService, color: Colors.white, fontWeight: FontWeight.normal, fontSize: 10, @@ -736,13 +849,15 @@ class _HomePageState extends State { opacity: 0.5, color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, - onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())), + onTap: () => Navigator.push( + context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( onTap: () { // Navigator.push( // context, FadePage(page: FeedbackHomePage())); - Navigator.push(context, FadePage(page: ContactUsPage())); + Navigator.push( + context, FadePage(page: ContactUsPage())); }, child: Container( width: double.infinity, @@ -864,8 +979,10 @@ class DashboardItem extends StatelessWidget { ? DecorationImage( image: ExactAssetImage('assets/images/$imageName'), fit: BoxFit.cover, - colorFilter: - hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, + colorFilter: hasColorFilter + ? new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn) + : null, ) : null, ), diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index bbad8d4c..d74dd6c8 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; @@ -21,6 +22,7 @@ class _LiveCareHomeState extends State bool isDataLoaded = false; bool hasLiveCareRequest = false; + List imagesInfo = List(); List erRequestHistoryList; @@ -32,7 +34,11 @@ class _LiveCareHomeState extends State erRequestHistoryList = List(); pendingERRequestHistoryList = new ErRequestHistoryList(); - + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/ar/0.png')); WidgetsBinding.instance.addPostFrameCallback((_) { if (!isDataLoaded) getLiveCareHistory(); }); @@ -45,6 +51,8 @@ class _LiveCareHomeState extends State return AppScaffold( appBarTitle: "LiveCare", isShowAppBar: true, + imagesInfo: imagesInfo, + description: TranslationBase.of(context).erConsultation, body: Container( child: Column(children: [ /// this is will not colored with theme data diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c5da90d5..1c0fd13e 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -64,11 +64,6 @@ class _Login extends State { void initState() { // getDeviceToken(); super.initState(); - - if(BASE_URL.contains("uat.")){ - nationalIDorFile.text = "1231755"; - mobileNumberController.text = mobileNo = "537503378"; - } } getDeviceToken() async { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f1a7f0b5..b26982dd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1161,7 +1161,8 @@ class TranslationBase { String get stretcher => localizedValues['stretcher'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; - String get RapidResponseTeam => localizedValues['Rapid-Response-Team'][locale.languageCode]; + String get RapidResponseTeam => + localizedValues['Rapid-Response-Team'][locale.languageCode]; String get rrtService => localizedValues['rrtService'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode]; String get transportMethod => @@ -1649,6 +1650,10 @@ class TranslationBase { String get pleaseAcceptTerms => localizedValues["please-accept-terms"][locale.languageCode]; String get type => localizedValues["type"][locale.languageCode]; + String get eReferralInfo => + localizedValues["info-ereferral"][locale.languageCode]; + String get erConsultation => + localizedValues["er-consultation"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 7ad4e03c1a0e383a8e4dd46d44760ab339da8c7b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 4 Aug 2021 17:30:31 +0300 Subject: [PATCH 15/39] =?UTF-8?q?PAP-715=20:=20Y=20=E2=80=93axis=20and=20X?= =?UTF-8?q?=20=E2=80=93axis=20values=20should=20be=20display=20in=20the=20?= =?UTF-8?q?yearly=20graph=20details.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/CurvedChartBloodPressure.dart | 10 ++-------- .../my_trackers/widget/LineChartCurved.dart | 18 ++---------------- .../widget/MonthCurvedChartBloodPressure.dart | 18 ++++++++++-------- .../widget/MonthLineChartCurved.dart | 18 ++++++++++-------- .../medical/vital_sign/LineChartCurved.dart | 17 ++--------------- .../LineChartCurvedBloodPressure.dart | 5 ++--- 6 files changed, 28 insertions(+), 58 deletions(-) diff --git a/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart index ac2349bc..7248b7e0 100644 --- a/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart +++ b/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart @@ -158,19 +158,13 @@ class CurvedChartBloodPressure extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, + interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + getTextStyles: (value) => const TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 10, ), - getTitles: (value) { - if (value.toInt() == 0) - return '${value.toInt()}'; - else if (value.toInt() % horizontalInterval == 0) - return '${value.toInt()}'; - else - return ''; - }, margin: 12, ), ), diff --git a/lib/pages/medical/my_trackers/widget/LineChartCurved.dart b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart index 3cf5c94f..7c5d9f08 100644 --- a/lib/pages/medical/my_trackers/widget/LineChartCurved.dart +++ b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart @@ -86,7 +86,6 @@ class LineChartCurved extends StatelessWidget { } } } - LineChartData sampleData1(context) { return LineChartData( lineTouchData: LineTouchData( @@ -131,26 +130,13 @@ class LineChartCurved extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, + interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, getTextStyles: (value) => const TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 10, ), - getTitles: (value) { - // if (value.toInt() == 0) - // return '${value.toInt()}'; - // else if (value.toInt() % horizontalInterval == 0) - // return '${value.toInt()}'; - // else - // return ''; - // if (value.toInt() == 0) - // return '${value.toInt()}'; - // else if (value.toInt() % horizontalInterval == 0) - // return '${value.toInt()}'; - // else - return '${value.toInt()}';//'${(value.toInt() +(horizontalInterval - value.toInt() % horizontalInterval) )}'; - }, margin: 12, ), ), @@ -175,7 +161,7 @@ class LineChartCurved extends StatelessWidget { minX: 0, maxX: (timeSeries.length - 1).toDouble(), maxY: getMaxY() + 0.3, - minY: getMinY(), + minY: 0,//getMinY(), lineBarsData: getData(context), ); } diff --git a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart index dd432d3b..ee7e00af 100644 --- a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart +++ b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart @@ -137,19 +137,21 @@ class MonthCurvedChartBloodPressure extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, + interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + getTextStyles: (value) => const TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 10, ), - getTitles: (value) { - // if (value.toInt() == 0) - // return '${value.toInt()}'; - // else if (value.toInt() % horizontalInterval == 0) - // return '${value.toInt()}'; - // else - return '${value.toInt()}'; - }, + // getTitles: (value) { + // // if (value.toInt() == 0) + // // return '${value.toInt()}'; + // // else if (value.toInt() % horizontalInterval == 0) + // // return '${value.toInt()}'; + // // else + // return '${value.toInt()}'; + // }, margin: 12, ), ), diff --git a/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart index 607f3ab0..3f1ecd22 100644 --- a/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart +++ b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart @@ -120,14 +120,16 @@ class MonthLineChartCurved extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 10, ), - getTitles: (value) { - if (value.toInt() == 0) - return '${value.toInt()}'; - else if (value.toInt() % horizontalInterval == 0) - return '${value.toInt()}'; - else - return ''; - }, + interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + + // getTitles: (value) { + // if (value.toInt() == 0) + // return '${value.toInt()}'; + // else if (value.toInt() % horizontalInterval == 0) + // return '${value.toInt()}'; + // else + // return ''; + // }, margin: 12, ), ), diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart index 76610708..e62a300a 100644 --- a/lib/pages/medical/vital_sign/LineChartCurved.dart +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -134,21 +134,8 @@ class LineChartCurved extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 10, ), - getTitles: (value) { - if (timeSeries.length < 15) { - return '${value.toInt()}'; - } else { - if (value == minY) - return '${value.toInt()}'; - if (value == getMaxY()) - return '${value.toInt()}'; - //if (yAxixs.contains(value)) { - return '${value.toInt()}'; - - return ''; - } - return '${value.toInt()}'; - }, + interval:getMaxY() - getMinY() <=500?getMaxY() - getMinY() <=50?10:50:getMaxY() - getMinY() <=1000?100:getMaxY() - getMinY()>=10000?5000:200, + margin: 12, ), ), diff --git a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart index 2d95f08c..e656d60e 100644 --- a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart @@ -151,9 +151,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 10, ), - getTitles: (value) { - return '${value.toInt()}'; - }, + interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + margin: 12, ), ), From 5f1d75389505d99a69042f27c67c754d0939907b Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Thu, 5 Aug 2021 09:58:05 +0300 Subject: [PATCH 16/39] no message --- lib/pages/ErService/ErOptions.dart | 3 +- .../rapid-response-team/rrt-logs-page.dart | 87 +++++++++++++++++++ .../rapid-response-team/rrt-main-screen.dart | 76 ++++++++++++++++ .../rapid-response-team/rrt-request-page.dart | 47 ++++++++++ 4 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 lib/pages/rapid-response-team/rrt-logs-page.dart create mode 100644 lib/pages/rapid-response-team/rrt-main-screen.dart create mode 100644 lib/pages/rapid-response-team/rrt-request-page.dart diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index a6a61749..254acd8e 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-main-screen.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -120,7 +121,7 @@ class _ErOptionsState extends State { Navigator.push( context, FadePage( - page: NearestEr())); + page: RRTMainScreen())); }), ) ], diff --git a/lib/pages/rapid-response-team/rrt-logs-page.dart b/lib/pages/rapid-response-team/rrt-logs-page.dart new file mode 100644 index 00000000..60a0d7cc --- /dev/null +++ b/lib/pages/rapid-response-team/rrt-logs-page.dart @@ -0,0 +1,87 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class RRTLogPage extends StatefulWidget{ + + @override + State createState() => RRTLogPageState(); + +} +class RRTLogPageState extends State{ + @override + Widget build(BuildContext context) { + return Center( + child: ListView.builder( + itemCount: 10, + itemBuilder: (ctx, idx) => RRTLogListItem() + ) + ); + } + +} + + + +// ------------------------ +// List Item Widget +// ------------------------ + + +final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); + +class RRTLogListItem extends StatelessWidget{ + BuildContext _context; + @override + Widget build(BuildContext context) { + _context = context; + + return Container( + padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)] + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + _contentItem(label: "Request ID", value: "2318"), + _item_content_seperator, + _contentItem(label: "Status", value: "2318"), + _item_content_seperator, + _contentItem(label: "Pickup Date", value: "2318"), + _item_content_seperator, + _contentItem(label: "Location", value: "2318"), + _item_content_seperator, + SizedBox(height: 10), + FractionallySizedBox(child: cancelButton()) + ], + ), + ); + } + + Widget _contentItem({@required String label, String value}){ + return Container( + padding: EdgeInsets.symmetric(vertical: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),), + SizedBox(height: 5,), + Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),), + ], + ), + ); + } + + Widget cancelButton()=> MaterialButton( + height: 45, + color: Color(0xFFc5272d), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Text("CANCEL", style: TextStyle(color: Colors.white, fontSize: 13),), + + ); +} + diff --git a/lib/pages/rapid-response-team/rrt-main-screen.dart b/lib/pages/rapid-response-team/rrt-main-screen.dart new file mode 100644 index 00000000..d9afa582 --- /dev/null +++ b/lib/pages/rapid-response-team/rrt-main-screen.dart @@ -0,0 +1,76 @@ +import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-logs-page.dart'; +import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-request-page.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RRTMainScreen extends StatefulWidget{ + @override + State createState() => RRTMainScreenState(); +} + +class RRTMainScreenState extends State with SingleTickerProviderStateMixin{ + + int currentIndex = 0; + TabController tabController; + PageController pageController = PageController(initialPage: 0); + + @override + void initState() { + super.initState(); + tabController = TabController(length: 2, vsync: this); + } + + @override + Widget build(BuildContext context) { + + return AppScaffold( + appBarTitle: 'Rapid Response Team', + isShowAppBar: true, + body: Column( + children: [ + tabBar(), + Expanded( + child: contentPager() + ) + ], + ), + ); + } + + Widget tabBar() => Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 15), + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), + child: TabBar( + onTap: onPageChanged, + indicatorWeight: 3, + indicatorColor: Color(0xFFc5272d), + isScrollable: false, + controller: tabController, + indicatorSize: TabBarIndicatorSize.label, + tabs: [ + Tab( + child: Text("Rapid Response Team", style: TextStyle(color: Theme.of(context).appBarTheme.color),), + ), + Tab( + child: Text("Order Log", style: TextStyle(color: Theme.of(context).appBarTheme.color),), + ), + ] + ), + ); + + Widget contentPager() => PageView( + onPageChanged: onPageChanged, + controller: pageController, + children: [ + RRTRequestPage(), + RRTLogPage(), + ], + ); + + void onPageChanged(int index) { + pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut); + tabController.animateTo(index); + } +} diff --git a/lib/pages/rapid-response-team/rrt-request-page.dart b/lib/pages/rapid-response-team/rrt-request-page.dart new file mode 100644 index 00000000..67573133 --- /dev/null +++ b/lib/pages/rapid-response-team/rrt-request-page.dart @@ -0,0 +1,47 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RRTRequestPage extends StatefulWidget{ + + @override + State createState() => RRTRequestPageState(); + +} +class RRTRequestPageState extends State{ + @override + Widget build(BuildContext context) { + return ListView( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + children: [ + serviceDescription(context), + SizedBox(height: 20), + priceTable(context), + ], + ); + } + + Widget serviceDescription(BuildContext context) => + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Text( + "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home", + textAlign: TextAlign.justify, + style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300), + ), + ); + + Widget priceTable(BuildContext context){ + var radius = Radius.circular(8); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + height: 30, + decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), + child: Center(child: Text("Approximate Service Fee", style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), + ) + ], + ); + } + +} \ No newline at end of file From 4da163d1867f8c7a0ed807810c0edd93c435508e Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Thu, 5 Aug 2021 14:38:38 +0300 Subject: [PATCH 17/39] RRT in progress in stage --- assets/payment_options/payment_options.png | Bin 0 -> 22119 bytes lib/config/config.dart | 4 + lib/config/localized_values.dart | 7 + lib/core/viewModels/er/rrt-view-model.dart | 48 +++++ lib/locator.dart | 3 + lib/pages/ErService/ErOptions.dart | 2 +- .../rapid-response-team/rrt-logs-page.dart | 19 +- .../rapid-response-team/rrt-main-screen.dart | 9 +- .../rrt-pickup-address-page.dart | 92 +++++++++ .../rapid-response-team/rrt-request-page.dart | 176 ++++++++++++++++++ .../rapid-response-team/rrt-request-page.dart | 47 ----- lib/uitl/translations_delegate_base.dart | 7 + pubspec.yaml | 1 + 13 files changed, 357 insertions(+), 58 deletions(-) create mode 100644 assets/payment_options/payment_options.png create mode 100644 lib/core/viewModels/er/rrt-view-model.dart rename lib/pages/{ => ErService}/rapid-response-team/rrt-logs-page.dart (84%) rename lib/pages/{ => ErService}/rapid-response-team/rrt-main-screen.dart (86%) create mode 100644 lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart create mode 100644 lib/pages/ErService/rapid-response-team/rrt-request-page.dart delete mode 100644 lib/pages/rapid-response-team/rrt-request-page.dart diff --git a/assets/payment_options/payment_options.png b/assets/payment_options/payment_options.png new file mode 100644 index 0000000000000000000000000000000000000000..4bb83fec564f0ee729423d991b449e9849e9bf5a GIT binary patch literal 22119 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 QrViewModel()); locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => NearHospitalViewModel()); + locator.registerFactory(() => RRTViewModel()); locator.registerFactory(() => AmRequestViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); locator.registerFactory(() => MyBalanceViewModel()); @@ -304,6 +306,7 @@ void setupLocator() { locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model locator.registerFactory(() => PackagesViewModel()); // Products View Model + //pharmacy // locator.registerFactory(() => PharmacyCategoriseViewModel()); // locator.registerFactory(() => OffersCategoriseViewModel()); diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 254acd8e..05121f0f 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -1,7 +1,7 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-main-screen.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; diff --git a/lib/pages/rapid-response-team/rrt-logs-page.dart b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart similarity index 84% rename from lib/pages/rapid-response-team/rrt-logs-page.dart rename to lib/pages/ErService/rapid-response-team/rrt-logs-page.dart index 60a0d7cc..acfe13d8 100644 --- a/lib/pages/rapid-response-team/rrt-logs-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -11,11 +13,16 @@ class RRTLogPage extends StatefulWidget{ class RRTLogPageState extends State{ @override Widget build(BuildContext context) { - return Center( - child: ListView.builder( - itemCount: 10, - itemBuilder: (ctx, idx) => RRTLogListItem() - ) + return BaseView( + onModelReady: (viewModel){ + + }, + builder: (ctx, vm, widget){ + return ListView.builder( + itemCount: 10, + itemBuilder: (ctx, idx) => RRTLogListItem() + ); + } ); } @@ -75,7 +82,7 @@ class RRTLogListItem extends StatelessWidget{ ); } - Widget cancelButton()=> MaterialButton( + Widget cancelButton() => MaterialButton( height: 45, color: Color(0xFFc5272d), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), diff --git a/lib/pages/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart similarity index 86% rename from lib/pages/rapid-response-team/rrt-main-screen.dart rename to lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index d9afa582..fe1c6a9d 100644 --- a/lib/pages/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -1,5 +1,6 @@ -import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-logs-page.dart'; -import 'package:diplomaticquarterapp/pages/rapid-response-team/rrt-request-page.dart'; + +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -13,7 +14,7 @@ class RRTMainScreenState extends State with SingleTickerProvider int currentIndex = 0; TabController tabController; - PageController pageController = PageController(initialPage: 0); + PageController pageController = PageController(initialPage: 0, keepPage: true); @override void initState() { @@ -39,7 +40,7 @@ class RRTMainScreenState extends State with SingleTickerProvider } Widget tabBar() => Container( - margin: EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.all(15), clipBehavior: Clip.hardEdge, decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), child: TabBar( diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart new file mode 100644 index 00000000..91e9cbd2 --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -0,0 +1,92 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class RRTRequestPickupAddressPage extends StatefulWidget{ + + @override + State createState() => RRTRequestPickupAddressPageState(); + +} +class RRTRequestPickupAddressPageState extends State{ + bool acceptTerms = false; + Completer mapController = Completer(); + + static final CameraPosition mapCamera = CameraPosition( + target: LatLng(37.42796133580664, -122.085749655962), + zoom: 14.4746, + ); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (viewModel){ + + }, + builder: (ctx, vm, widget) => AppScaffold( + appBarTitle: TranslationBase.of(context).pickupLocation, + isShowAppBar: true, + body: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + selectAddress(), + Expanded( + child: GoogleMap( + mapType: MapType.normal, + initialCameraPosition: mapCamera, + onCameraIdle: (){ + + }, + onMapCreated: (controller){ + mapController.complete(controller); + }, + ) + ), + continueButton() + ], + ) + ) + ); + } + + Widget selectAddress(){ + return Container( + margin: EdgeInsets.all(15), + child: Expanded( + child: MaterialButton( + height: 50, + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Row( + children: [ + Text(TranslationBase.of(context).selectAddress, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + Spacer(), + Icon(Icons.keyboard_arrow_down, size: 15, color: Colors.grey,) + ], + ), + ), + ), + ); + } + + Widget continueButton(){ + return Padding( + padding: const EdgeInsets.all(15), + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Text(TranslationBase.of(context).continues, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),), + ), + ); + } + +} \ No newline at end of file diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart new file mode 100644 index 00000000..9fb0a2f5 --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -0,0 +1,176 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RRTRequestPage extends StatefulWidget{ + + @override + State createState() => RRTRequestPageState(); + +} +class RRTRequestPageState extends State{ + bool acceptTerms = false; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (viewModel){ + + }, + builder: (ctx, vm, widget) => Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + children: [ + serviceDescription(context), + SizedBox(height: 20), + priceTable(context), + + acceptPolicy(), + + Container(height: 0.5, color: Theme.of(context).appBarTheme.color),// Seperator + + Container( + padding: EdgeInsets.only(top: 20, bottom: 5), + alignment: Alignment.center, + child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2) + ), + + paymentOptions(), + ], + ), + ), + + actionButtons() + ], + ) + ); + } + + Widget serviceDescription(BuildContext context) => + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10), + child: Text( + TranslationBase.of(context).RRTDDetails, + textAlign: TextAlign.justify, + style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300), + ), + ); + + Widget priceTable(BuildContext context){ + var radius = Radius.circular(8); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + height: 30, + decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), + child: Center(child: Text(TranslationBase.of(context).ApproximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), + ), + + pricingRow(label: TranslationBase.of(context).AmountBeforeTax, value: '500 SAR'), + Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + + pricingRow(label: TranslationBase.of(context).TaxAmount, value: '50 SAR'), + Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + + pricingRow(label: TranslationBase.of(context).TotalAmountPayable, value: '550 SAR', labelBold: true), + Container(height: 0.5, color: Theme.of(context).appBarTheme.color), + ], + ); + } + + Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}){ + return + Container( + height: 40, margin: EdgeInsets.symmetric(horizontal: 10), + child: Row( + children: [ + Text(label, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: labelBold ? FontWeight.bold : FontWeight.normal)), + Spacer(), + Container(height: 40, color: Theme.of(context).appBarTheme.color, width: 0.5,), + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width * 0.25, + child: Text(value, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: valueBold ? FontWeight.bold : FontWeight.normal)) + ), + ], + ), + ); + } + + + Widget acceptPolicy(){ + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Row( + children: [ + Checkbox(value: acceptTerms, onChanged: (v){ + setState(() => acceptTerms = v); + }), + SizedBox(width: 10), + Expanded( + child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2) + ), + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width * 0.25, + child: TextButton( + child: Text(TranslationBase.of(context).clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)), + onPressed: (){ + + } + ), + ) + ], + ), + ); + } + + Widget paymentOptions()=> Container( + height: 30, + alignment: Alignment.center, + child: Image.asset("assets/payment_options/payment_options.png", fit: BoxFit.fill,) + ); + + Widget actionButtons(){ + return Container( + margin: EdgeInsets.all(15), + child: Row( + children: [ + Expanded( + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () { }, + child: Text(TranslationBase.of(context).cancel, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + + ), + ), + SizedBox(width: 20,), + Expanded( + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + child: Text(TranslationBase.of(context).ok, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + onPressed: () { + Navigator.push( + context, + FadePage( + page: RRTRequestPickupAddressPage())); + }, + ), + ) + ], + ), + ); + } + +} \ No newline at end of file diff --git a/lib/pages/rapid-response-team/rrt-request-page.dart b/lib/pages/rapid-response-team/rrt-request-page.dart deleted file mode 100644 index 67573133..00000000 --- a/lib/pages/rapid-response-team/rrt-request-page.dart +++ /dev/null @@ -1,47 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class RRTRequestPage extends StatefulWidget{ - - @override - State createState() => RRTRequestPageState(); - -} -class RRTRequestPageState extends State{ - @override - Widget build(BuildContext context) { - return ListView( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), - children: [ - serviceDescription(context), - SizedBox(height: 20), - priceTable(context), - ], - ); - } - - Widget serviceDescription(BuildContext context) => - Padding( - padding: const EdgeInsets.symmetric(horizontal: 10), - child: Text( - "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home", - textAlign: TextAlign.justify, - style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300), - ), - ); - - Widget priceTable(BuildContext context){ - var radius = Radius.circular(8); - return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Container( - height: 30, - decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), - child: Center(child: Text("Approximate Service Fee", style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), - ) - ], - ); - } - -} \ No newline at end of file diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 2a966715..6610a6af 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1160,6 +1160,13 @@ class TranslationBase { String get none => localizedValues['none'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; String get RapidResponseTeam => localizedValues['Rapid-Response-Team'][locale.languageCode]; + String get RRTDDetails => localizedValues['RRTDDetails'][locale.languageCode]; + String get ApproximateServiceFee => localizedValues['ApproximateServiceFee'][locale.languageCode]; + String get AmountBeforeTax => localizedValues['AmountBeforeTax'][locale.languageCode]; + String get TaxAmount => localizedValues['TaxAmount'][locale.languageCode]; + String get TotalAmountPayable => localizedValues['TotalAmountPayable'][locale.languageCode]; + String get iAcceptTermsConditions => localizedValues['iAcceptTermsConditions'][locale.languageCode]; + String get YouCanPayByTheFollowingOptions => localizedValues['YouCanPayByTheFollowingOptions'][locale.languageCode]; String get rrtService => localizedValues['rrtService'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode]; String get transportMethod => diff --git a/pubspec.yaml b/pubspec.yaml index aab0cf32..cd1f5a12 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -224,6 +224,7 @@ flutter: - assets/images/pharmacy_module/payment/ - assets/images/pharmacy_module/lakum/ - assets/images/nfc/ + - assets/payment_options/ fonts: From d6fd03b571b0d8ea9dd8f15d7aa2178a46029e49 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 5 Aug 2021 14:51:27 +0300 Subject: [PATCH 18/39] CONFIG --- lib/config/config.dart | 401 ++++++++++++------- lib/widgets/in_app_browser/InAppBrowser.dart | 58 +-- 2 files changed, 297 insertions(+), 162 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index da6defa6..3f84175d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -17,12 +17,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs -const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; -const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +//const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // Pharmacy Production URLs -//const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -//const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; @@ -33,7 +33,8 @@ const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; // Delivery Driver -const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; +const DRIVER_LOCATION = + 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; //weather const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; @@ -41,36 +42,51 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; // Wifi Credentials -const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; +const WIFI_CREDENTIALS = + "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; ///Doctor -const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_MY_DOCTOR = + 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; -const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; -const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; +const GET_DOCTOR_RATING_NOTES = + 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +const GET_DOCTOR_RATING_DETAILS = + 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_Patient_LAB_SPECIAL_RESULT = + 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = + 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; +const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = + 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; -const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; +const GET_PATIENT_ORDERS_DETAILS = + 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; -const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; +const SEND_RAD_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendRadReportEmail'; ///Feedback const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; @@ -79,23 +95,32 @@ const GET_PATIENT_AppointmentHistory = 'Services' '/Doctors.svc/REST/PateintHasAppoimentHistory'; ///VITAL SIGN -const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN = + 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; ///Er Nearest -const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; +const GET_NEAREST_HOSPITAL = + 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///ED Online -const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; -const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; +const ER_GET_VISUAL_TRIAGE_QUESTIONS = + "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; +const ER_SAVE_TRIAGE_INFORMATION = + "services/Doctors.svc/REST/ER_SaveTriageInformation"; const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; ///Er Nearest -const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; -const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; -const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; -const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +const GET_AMBULANCE_REQUEST = + 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +const GET_PATIENT_ALL_PRES_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = + 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; +const UPDATE_PRESS_ORDER = + 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; +const INSERT_ER_INERT_PRES_ORDER = + 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; ///FindUs const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; @@ -104,13 +129,15 @@ const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; ///babyInformation -const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID'; +const GET_BABYINFORMATION_REQUEST = + 'Services/Community.svc/REST/GetBabyByUserID'; ///Get Baby By User ID const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation -const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; +const GET_USERINFORMATION_REQUEST = + 'Services/Community.svc/REST/GetUserInformation_New'; ///Update email const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; @@ -132,21 +159,29 @@ const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; ///BloodDetails -const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; +const GET_BLOOD_REQUEST = + 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; -const SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +const SAVE_BLOOD_REQUEST = + 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -const GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; -const SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +const GET_BLOOD_AGREEMENT = + 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; +const SAVE_BLOOD_AGREEMENT = + 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; ///Reports const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; -const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; -const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; +const INSERT_REQUEST_FOR_MEDICAL_REPORT = + 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +const SEND_MEDICAL_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendMedicalReportEmail'; ///Rate -const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; -const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; +const IS_LAST_APPOITMENT_RATED = + 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; +const GET_APPOINTMENT_DETAILS_BY_NO = + 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; @@ -158,7 +193,8 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; //URL to get active appointment list -const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; +const GET_ACTIVE_APPOINTMENTS_LIST_URL = + "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; //URL to get projects list const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; @@ -167,87 +203,118 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; //URL to dental doctors list -const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; +const GET_DENTAL_DOCTORS_LIST_URL = + "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; //URL to get doctor free slots const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; //URL to insert appointment -const INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment"; +const INSERT_SPECIFIC_APPOINTMENT = + "Services/Doctors.svc/REST/InsertSpecificAppointment"; //URL to get patient share -const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; +const GET_PATIENT_SHARE = + "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; //URL to get patient appointment history -const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; +const GET_PATIENT_APPOINTMENT_HISTORY = + "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; -const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; +const SEND_REPORT_EYE_EMAIL = + "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; -const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; +const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = + "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; //URL to get patient appointment curfew history -const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; +const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = + "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; //URL to confirm appointment -const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; +const CONFIRM_APPOINTMENT = + "Services/MobileNotifications.svc/REST/ConfirmAppointment"; -const INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; +const INSERT_VIDA_REQUEST = + "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; //URL to cancel appointment const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; //URL get appointment QR -const GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; +const GENERATE_QR_APPOINTMENT = + "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; //URL send email appointment QR -const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; +const EMAIL_QR_APPOINTMENT = + "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; //URL check payment status -const CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; +const CHECK_PAYMENT_STATUS = + "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; //URL create advance payment const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; -const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; +const HIS_CREATE_ADVANCE_PAYMENT = + "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; -const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; +const ADD_ADVANCE_NUMBER_REQUEST = + 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; -const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; -const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; -const ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; +const IS_ALLOW_ASK_DOCTOR = + 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_CALL_REQUEST_TYPE = + 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +const ADD_VIDA_REQUEST = + 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; -const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; +const GET_LIVECARE_CLINICS = + 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; -const GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; +const GET_LIVECARE_SCHEDULE_CLINICS = + 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; -const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; +const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = + 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; -const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; +const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = + 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; -const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; +const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = + 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; const GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; -const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; +const GET_LIVECARE_CLINIC_TIMING = + 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; -const GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; +const GET_ER_APPOINTMENT_FEES = + 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; -const ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; +const ADD_NEW_CALL_FOR_PATIENT_ER = + 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; -const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; -const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; -const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; +const GET_LIVECARE_HISTORY = + 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; +const CANCEL_LIVECARE_REQUEST = + 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; +const SEND_LIVECARE_INVOICE_EMAIL = + 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; -const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; +const UPDATE_HEALTH_TERMS = + 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; -const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; +const GET_PATIENT_HEALTH_STATS = + 'Services/Patients.svc/REST/Med_GetTransactionsSts'; -const SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; +const SEND_CHECK_IN_NFC_REQUEST = + 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; //URL to get medicine and pharmacies list const CHANNEL = 3; @@ -268,16 +335,21 @@ var DeviceTypeID = Platform.isIOS ? 1 : 2; const LANGUAGE_ID = 2; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; -const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; +const GET_PAtIENTS_INSURANCE = + "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; +const GET_PAtIENTS_INSURANCE_UPDATED = + "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; -const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; -const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; +const GET_PATIENT_INSURANCE_DETAILS = + "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +const UPLOAD_INSURANCE_CARD = + 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; -const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = + "Services/Patients.svc/REST/GetApprovalStatus"; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; @@ -287,57 +359,84 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; -const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; -const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = + 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +const GET_PATIENT_INFO_BY_ID = + 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; -const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = + 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; -const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; +const GET_COVID_DRIVETHRU_PROJECT_LIST = + 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; -const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; +const GET_COVID_DRIVETHRU_PAYMENT_INFO = + 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; -const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +const GET_COVID_DRIVETHRU_FREE_SLOTS = + 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; const GET_COVID_DRIVETHRU_PROCEDURES_LIST = 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; ///Smartwatch Integration Services -const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; +const GET_PATIENT_LAST_RECORD = + 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; ///My Trackers -const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; -const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; -const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; - -const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; -const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; -const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; - -const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; -const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; -const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; +const GET_DIABETIC_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +const GET_DIABTEC_RESULT = + 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; +const ADD_DIABTEC_RESULT = + 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; + +const GET_BLOOD_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +const GET_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +const ADD_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; + +const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +const GET_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +const ADD_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; -const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; -const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; - -const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; - -const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; -const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; -const DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; - -const UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; -const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; -const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; - -const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; -const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; +const GET_CALL_INFO_HOURS_RESULT = + 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +const GET_CALL_REQUEST_TYPE_LOV = + 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; + +const UPDATE_DIABETIC_RESULT = + 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; + +const SEND_AVERAGE_BLOOD_SUGAR_REPORT = + 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; +const DEACTIVATE_DIABETIC_STATUS = + 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; +const DEACTIVATE_BLOOD_PRESSURES_STATUS = + 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; + +const UPDATE_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; +const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = + 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; +const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = + 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; + +const UPDATE_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; +const DEACTIVATE_WEIGHT_PRESSURE_RESULT = + 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; @@ -345,25 +444,35 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; // H2O -const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; -const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; -const H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; -const H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; -const H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; +const H2O_GET_USER_PROGRESS = + "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +const H2O_INSERT_USER_ACTIVITY = + "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +const H2O_GET_USER_DETAIL = + "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; +const H2O_UPDATE_USER_DETAIL = + "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; +const H2O_UNDO_USER_ACTIVITY = + "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; //E_Referral Services -const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; -const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; -const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; +const GET_ALL_RELATIONSHIP_TYPES = + "Services/Patients.svc/REST/GetAllRelationshipTypes"; +const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = + 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; +const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = + 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; // Encillary Orders -const GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; +const GET_ANCILLARY_ORDERS = + 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; -const GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; +const GET_ANCILLARY_ORDERS_DETAILS = + 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; //Pharmacy wishlist // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; @@ -395,34 +504,50 @@ const GET_SHIPPING_OPTIONS = "get_shipping_option/"; const DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; const ORDER_SHOPPING_CART = "orders"; -const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; -const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; -const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; -const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation"; -const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount"; -const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; -const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; +const GET_LACUM_ACCOUNT_INFORMATION = + "Services/Patients.svc/REST/GetLakumAccountInformation"; +const GET_LACUM_GROUP_INFORMATION = + "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; +const LACUM_ACCOUNT_ACTIVATE = + "Services/Patients.svc/REST/LakumAccountActivation"; +const LACUM_ACCOUNT_DEACTIVATE = + "Services/Patients.svc/REST/LakumAccountDeactivation"; +const CREATE_LAKUM_ACCOUNT = + "Services/Patients.svc/REST/PHR_CreateLakumAccount"; +const TRANSFER_YAHALA_LOYALITY_POINTS = + "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; +const LAKUM_GET_USER_TERMS_AND_CONDITIONS = + "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_MOST_VIEWED_PRODUCTS = "mostview?"; const GET_NEW_PRODUCTS = "newproducts?"; // Home Health Care -const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; -const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; -const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; -const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; -const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; +const HHC_GET_ALL_SERVICES = + "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +const HHC_GET_ALL_CMC_SERVICES = + "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +const PATIENT_ER_UPDATE_PRES_ORDER = + "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; +const GET_ORDER_DETAIL_BY_ID = + "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; +const GET_CMC_ORDER_DETAIL_BY_ID = + "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; -const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +const GET_PATIENT_ALL_PRES_ORD = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const PATIENT_ER_INSERT_PRES_ORDER = + 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; -const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +const BLOOD_DONATION_REGISTER_BLOOD_TYPE = + 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = + 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; //Pharmacy wishlist const GET_WISHLIST = "shopping_cart_items/"; @@ -455,7 +580,8 @@ const GET_SUB_PRODUCTS = 'products?categoryid='; const GET_FINAL_PRODUCTS = 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; -const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; +const GET_DISEASE_BY_CLINIC_ID = + 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; const TIMER_MIN = 10; @@ -471,7 +597,8 @@ const SCAN_QR_CODE = 'productbysku/'; const FILTERED_PRODUCTS = 'products?categoryids='; -const GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; +const GET_DOCTOR_LIST_CALCULATION = + "Services/Doctors.svc/REST/GetCallculationDoctors"; class AppGlobal { static var context; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 946876a7..e66b2eae 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -12,26 +12,28 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -enum _PAYMENT_TYPE{PACKAGES, PHARMACY, PATIENT} +enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } var _InAppBrowserOptions = InAppBrowserClassOptions( - inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)), + inAppWebViewGroupOptions: InAppWebViewGroupOptions( + crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)), crossPlatform: InAppBrowserOptions(hideUrlBar: true), - ios: IOSInAppBrowserOptions(toolbarBottom: false,) -); + ios: IOSInAppBrowserOptions( + toolbarBottom: false, + )); class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; - 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 + // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + + static String PREAUTH_SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; @@ -40,9 +42,12 @@ class MyInAppBrowser extends InAppBrowser { 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live // Packages - static String PACKAGES_REQUEST_PAYMENT_URL = '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1'; - static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess'; - static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed'; + static String PACKAGES_REQUEST_PAYMENT_URL = + '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1'; + static String PACKAGES_PAYMENT_SUCCESS_URL = + '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess'; + static String PACKAGES_PAYMENT_FAIL_URL = + '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed'; static List successURLS = [ 'success', @@ -71,7 +76,8 @@ class MyInAppBrowser extends InAppBrowser { static bool isPaymentDone = false; - MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); + MyInAppBrowser( + {this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); Future onBrowserCreated() async { print("\n\nBrowser Created!\n\n"); @@ -79,8 +85,7 @@ class MyInAppBrowser extends InAppBrowser { @override Future onLoadStart(String url) async { - if(onLoadStartCallback != null) - onLoadStartCallback(url); + if (onLoadStartCallback != null) onLoadStartCallback(url); } @override @@ -101,16 +106,18 @@ class MyInAppBrowser extends InAppBrowser { @override void onExit() { print("\n\nBrowser closed!\n\n"); - if(onExitCallback != null) - onExitCallback(appo, isPaymentDone); + if (onExitCallback != null) onExitCallback(appo, isPaymentDone); } @override - Future shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { + Future shouldOverrideUrlLoading( + ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { var url = shouldOverrideUrlLoadingRequest.url; debugPrint("redirecting/overriding to: $url"); - if(paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL,PACKAGES_PAYMENT_FAIL_URL].contains(url)){ + if (paymentType == _PAYMENT_TYPE.PACKAGES && + [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL] + .contains(url)) { isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL); close(); } @@ -140,9 +147,11 @@ class MyInAppBrowser extends InAppBrowser { } } - openPackagesPaymentBrowser({@required int customer_id, @required int order_id}){ + openPackagesPaymentBrowser( + {@required int customer_id, @required int order_id}) { paymentType = _PAYMENT_TYPE.PACKAGES; - var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id'; + var full_url = + '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id'; this.openUrl(url: full_url, options: _InAppBrowserOptions); } @@ -182,7 +191,6 @@ class MyInAppBrowser extends InAppBrowser { clinicID, doctorID) .then((value) { - paymentType = _PAYMENT_TYPE.PATIENT; this.browser.openUrl(url: value, options: _InAppBrowserOptions); }); @@ -391,4 +399,4 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser { void onClosed() { print("ChromeSafari browser closed"); } -} \ No newline at end of file +} From b01961e45f941ee4aea45cecab97ae2d793c77f0 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 5 Aug 2021 15:42:02 +0300 Subject: [PATCH 19/39] fix translate issues --- .../my_trackers/blood_pressure/AddBloodPressurePage.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 98058bcf..5355a22f 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -48,8 +48,8 @@ class _AddBloodPressurePageState extends State { int measuredArm = 1; bool isButtonDisabled = false; final List measureTimeEnList = [ - 'Left arm ', - 'Right arm', + 'Left Arm ', + 'Right Arm', ]; final List measureTimeArList = [ 'الذراع الأيسر', @@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State { ), InkWell( onTap: () { - confirmSelectMeasureTimeDialog(!projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); + confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); }, child: Container( padding: EdgeInsets.all(12), From e4256d6874688d71eb01172ae5f60602ba8eb5c8 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Thu, 5 Aug 2021 19:05:31 +0300 Subject: [PATCH 20/39] RRT in progress (Service implementations) --- lib/config/config.dart | 1 + lib/core/viewModels/er/rrt-view-model.dart | 73 ++++++++-- .../AmbulanceRequestIndexPages/Summary.dart | 2 +- lib/pages/ErService/ErOptions.dart | 2 +- .../rrt-pickup-address-page.dart | 133 +++++++++++++++--- .../rapid-response-team/rrt-request-page.dart | 16 +-- lib/uitl/translations_delegate_base.dart | 16 +-- lib/widgets/dialogs/selection-dailog.dart | 56 ++++++++ 8 files changed, 252 insertions(+), 47 deletions(-) create mode 100644 lib/widgets/dialogs/selection-dailog.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index f4d5ac91..d25dc616 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -125,6 +125,7 @@ const INSERT_ER_INERT_PRES_ORDER = /// ER RRT const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation'; const GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; +const GET_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; ///FindUs const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index a0ce7d07..975b01a1 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -1,4 +1,6 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import '../base_view_model.dart'; @@ -7,42 +9,91 @@ import '../base_view_model.dart'; class RRTService extends BaseService{ } - +class _RRTServiceOrders{ + List pendingOrders = []; + List completedOrders = []; +} class RRTViewModel extends BaseViewModel{ var _service = RRTService(); + _RRTServiceOrders rrtOrders = _RRTServiceOrders(); - Future createRequest(){ - - return null; + Future getRequiredData() async{ + getServicePrice(); + getAllOrders(); } + Future createOrder(){ + var body = {"Latitude":24.828170776367188,"Longitude":46.63229029757938,"IdentificationNo":"2344670985","NationalityID":"JOR","CreatedBy":1231755,"OrderServiceID":5,"Notes":""}; + _service.baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, body: body, onSuccess: (response, statusCode){ + print(response); + }, onFailure: (error, statusCode){ - Future getAllRequest(){ - + }); return null; } + // Service ID: 4 == RRT + Future<_RRTServiceOrders> getAllOrders() async{ + await _service.baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, body: {}, onSuccess: (response, statusCode){ + var data = response["PatientER_GetPatientAllPresOrdersList"]; + if(data != null && data is List){ + data.forEach((json){ + if(json["ServiceID"] == 4){ + if(json["Status"] == 1){ // Pending + rrtOrders.pendingOrders.clear(); + rrtOrders.pendingOrders.add(PrescriptionsOrder.fromJson(json)); + }else if (json["Status"] == 3){ // Completed + rrtOrders.completedOrders.clear(); + rrtOrders.completedOrders.add(PrescriptionsOrder.fromJson(json)); + } + } + }); + } + }, onFailure: (error, statusCode){ + print(error); + }); + return rrtOrders; + } + - Future getRequestDetails(){ + Future getOrderDetails(){ return null; } Future getAllQuestions(){ - + _service.baseAppClient.post(GET_ALL_RRT_QUESTIONS, body: {}, onSuccess: (response, statusCode){ + print(response); + }, onFailure: (error, statusCode){ + print(error); + }); return null; } - Future getCancelReasons(){ + Future getServicePrice(){ + var body = {"IdentificationNo":user.patientIdentificationNo}; + _service.baseAppClient.post(GET_RRT_SERVICE_PRICE, body: body, onSuccess: (response, statusCode){ + print(response); + }, onFailure: (error, statusCode){ + print(error); + }); + return null; + } + Future cancelOrder(){ + var body = {"PresOrderID":"2318","PresOrderStatus":4,"EditedBy":3,"RejectionReason":""}; + _service.baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, body: body, onSuccess: (response, statusCode){ + print(response); + }, onFailure: (error, statusCode){ + print(error); + }); return null; } - Future cancelRequest(){ - return null; + Future getCancelReasons(){ } } \ No newline at end of file diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 4ddfaaa3..d6d4372e 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -31,7 +31,7 @@ class _SummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(TranslationBase.of(context).RRTSummary), + Texts(TranslationBase.of(context).rrtSummary), SizedBox(height: 5,), Container( width: double.infinity, diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 05121f0f..d80d6566 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -116,7 +116,7 @@ class _ErOptionsState extends State { locked: rrtLocked, image: 'assets/images/new-design/AM.PNG', text: TranslationBase.of(context).rrtService, - subText: TranslationBase.of(context).RapidResponseTeam, + subText: TranslationBase.of(context).rapidResponseTeam, onTap:(){ Navigator.push( context, diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart index 91e9cbd2..5b6bf6f6 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -3,9 +3,12 @@ import 'dart:async'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_material_pickers/flutter_material_pickers.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; class RRTRequestPickupAddressPage extends StatefulWidget{ @@ -14,15 +17,26 @@ class RRTRequestPickupAddressPage extends StatefulWidget{ State createState() => RRTRequestPickupAddressPageState(); } -class RRTRequestPickupAddressPageState extends State{ +class RRTRequestPickupAddressPageState extends State with SingleTickerProviderStateMixin{ bool acceptTerms = false; - Completer mapController = Completer(); - static final CameraPosition mapCamera = CameraPosition( - target: LatLng(37.42796133580664, -122.085749655962), + bool mapIdle = true; + Completer mapController = Completer(); + CameraPosition mapCameraPosition = CameraPosition( + target: LatLng(24.7114693, 46.67469582), zoom: 14.4746, ); + + List myAdresses = ["One","Two","Three",]; + dynamic selectedAddress; + + @override + void initState(){ + super.initState(); + goToCurrentLocation(); + } + @override Widget build(BuildContext context) { return BaseView( @@ -37,15 +51,31 @@ class RRTRequestPickupAddressPageState extends State Container(height: 0.25, color: Colors.grey.withOpacity(0.7),) + ) + ); + } + + moveToLocation(LatLng location, {bool animate = true}) async{ + await Future.delayed(Duration(milliseconds: 200)); + mapCameraPosition = CameraPosition(target: location, zoom: 16.4746,); + if(animate) + (await mapController.future).animateCamera(CameraUpdate.newCameraPosition(mapCameraPosition),); + else + (await mapController.future).moveCamera(CameraUpdate.newCameraPosition(mapCameraPosition),); + } + + goToCurrentLocation() async{ + var location = await Geolocator.getLastKnownPosition(); + if(location == null){ + Geolocator.getCurrentPosition().then((value){ + moveToLocation(LatLng(value.latitude, value.longitude)); + }); + return; + } + + moveToLocation(LatLng(location.latitude, location.longitude), animate: false); + } } \ No newline at end of file diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index 9fb0a2f5..14a244d5 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -18,8 +18,8 @@ class RRTRequestPageState extends State{ @override Widget build(BuildContext context) { return BaseView( - onModelReady: (viewModel){ - + onModelReady: (viewModel) async{ + await viewModel.getRequiredData(); }, builder: (ctx, vm, widget) => Column( children: [ @@ -38,7 +38,7 @@ class RRTRequestPageState extends State{ Container( padding: EdgeInsets.only(top: 20, bottom: 5), alignment: Alignment.center, - child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2) + child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2) ), paymentOptions(), @@ -56,7 +56,7 @@ class RRTRequestPageState extends State{ Padding( padding: const EdgeInsets.symmetric(horizontal: 10), child: Text( - TranslationBase.of(context).RRTDDetails, + TranslationBase.of(context).rrtDDetails, textAlign: TextAlign.justify, style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300), ), @@ -70,16 +70,16 @@ class RRTRequestPageState extends State{ Container( height: 30, decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), - child: Center(child: Text(TranslationBase.of(context).ApproximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), + child: Center(child: Text(TranslationBase.of(context).approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), ), - pricingRow(label: TranslationBase.of(context).AmountBeforeTax, value: '500 SAR'), + pricingRow(label: TranslationBase.of(context).amountBeforeTax, value: '500 SAR'), Container(height: 0.5, color: Theme.of(context).appBarTheme.color), - pricingRow(label: TranslationBase.of(context).TaxAmount, value: '50 SAR'), + pricingRow(label: TranslationBase.of(context).taxAmount, value: '50 SAR'), Container(height: 0.5, color: Theme.of(context).appBarTheme.color), - pricingRow(label: TranslationBase.of(context).TotalAmountPayable, value: '550 SAR', labelBold: true), + pricingRow(label: TranslationBase.of(context).totalAmountPayable, value: '550 SAR', labelBold: true), Container(height: 0.5, color: Theme.of(context).appBarTheme.color), ], ); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6610a6af..9127f582 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1158,15 +1158,15 @@ class TranslationBase { String get walker => localizedValues['walker'][locale.languageCode]; String get stretcher => localizedValues['stretcher'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode]; - String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; - String get RapidResponseTeam => localizedValues['Rapid-Response-Team'][locale.languageCode]; - String get RRTDDetails => localizedValues['RRTDDetails'][locale.languageCode]; - String get ApproximateServiceFee => localizedValues['ApproximateServiceFee'][locale.languageCode]; - String get AmountBeforeTax => localizedValues['AmountBeforeTax'][locale.languageCode]; - String get TaxAmount => localizedValues['TaxAmount'][locale.languageCode]; - String get TotalAmountPayable => localizedValues['TotalAmountPayable'][locale.languageCode]; + String get rrtSummary => localizedValues['RRT-Summary'][locale.languageCode]; + String get rapidResponseTeam => localizedValues['Rapid-Response-Team'][locale.languageCode]; + String get rrtDDetails => localizedValues['RRTDDetails'][locale.languageCode]; + String get approximateServiceFee => localizedValues['ApproximateServiceFee'][locale.languageCode]; + String get amountBeforeTax => localizedValues['AmountBeforeTax'][locale.languageCode]; + String get taxAmount => localizedValues['TaxAmount'][locale.languageCode]; + String get totalAmountPayable => localizedValues['TotalAmountPayable'][locale.languageCode]; String get iAcceptTermsConditions => localizedValues['iAcceptTermsConditions'][locale.languageCode]; - String get YouCanPayByTheFollowingOptions => localizedValues['YouCanPayByTheFollowingOptions'][locale.languageCode]; + String get youCanPayByTheFollowingOptions => localizedValues['YouCanPayByTheFollowingOptions'][locale.languageCode]; String get rrtService => localizedValues['rrtService'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode]; String get transportMethod => diff --git a/lib/widgets/dialogs/selection-dailog.dart b/lib/widgets/dialogs/selection-dailog.dart new file mode 100644 index 00000000..a1f4c66d --- /dev/null +++ b/lib/widgets/dialogs/selection-dailog.dart @@ -0,0 +1,56 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectionDialog extends StatefulWidget{ + @override + State createState() => SelectionDialogState(); + + String title; + List items; + show({@required String title, @required List items}){ + this.title = title; + } +} + +class SelectionDialogState extends State{ + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(15)), + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(15), + child: Text(widget.title,), + ), + + Container(height: 0.5, color: Colors.grey,), + + ListView.separated( + padding: EdgeInsets.all(10), + itemCount: widget.items.length, + itemBuilder: (ctx,idx) => item(idx), + separatorBuilder: (ctx,idx) => Container(height: 0.25, color: Colors.grey.withOpacity(0.7),)) + ], + ), + ) + ], + ); + } + + Widget item(int idx){ + var model = widget.items[idx]; + return Container( + padding: EdgeInsets.all(10), + height: 20, + color: Colors.blue, + child: Text(model.toString()), + ); + } + +} \ No newline at end of file From 8b8e239d3f3a4f2c10505c30a185fd2d38d97da2 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 8 Aug 2021 09:06:17 +0300 Subject: [PATCH 21/39] fix button --- .../blood_pressure/AddBloodPressurePage.dart | 70 ++++++------- .../blood_suger/AddBloodSugarPage.dart | 98 ++++++++++--------- 2 files changed, 88 insertions(+), 80 deletions(-) diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 5355a22f..7547bc4e 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -224,40 +224,44 @@ class _AddBloodPressurePageState extends State { bottomSheet: Container( color: Colors.transparent, width: double.infinity, - height: MediaQuery.of(context).size.width * 0.2, - child: Padding( - padding: const EdgeInsets.all(15.0), - child: SecondaryButton( - loading: widget.model.state == ViewState.BusyLocal, - label: TranslationBase.of(context).save.toUpperCase(), - textColor: Colors.white, - color: isButtonDisabled ? Colors.grey[900] : Colors.grey, - onTap: () async { - if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); + height: MediaQuery.of(context).size.height * 0.10, + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SecondaryButton( + loading: widget.model.state == ViewState.BusyLocal, + label: TranslationBase.of(context).save.toUpperCase(), + textColor: Colors.white, + color: isButtonDisabled ? Colors.grey[900] : Colors.grey, + onTap: () async { + if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); - widget.model - .addORUpdateDiabtecResult( - isUpdate: widget.isUpdate, - bloodPressureDate: - '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: _bloodDiastolicValueController.text.toString(), - systolicePressure: _bloodSystolicValueController.text.toString(), - measuredArm: measuredArm, - ) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.BusyLocal) - AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - ; - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: widget.model.error); - }); - } - }), + widget.model + .addORUpdateDiabtecResult( + isUpdate: widget.isUpdate, + bloodPressureDate: + '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: measuredArm, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.BusyLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + ; + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.model.error); + }); + } + }), + ], + ), ), ), ); diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index 6d4755dc..075e107e 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -275,58 +275,62 @@ class _AddBloodSugarPageState extends State { bottomSheet: Container( color: Colors.transparent, width: double.infinity, - height: MediaQuery.of(context).size.width * 0.2, - child: Padding( - padding: const EdgeInsets.all(15.0), - child: SecondaryButton( - label: TranslationBase.of(context).save.toUpperCase(), - textColor: Colors.white, - color: isButtonDisabled ? Colors.grey[900] : Colors.grey, - onTap: () async { - if (_bloodSugarValueController.text.isNotEmpty) { - if (widget.isUpdate) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.bloodSugarViewMode - .updateDiabtecResult( - month: bloodSugarDate, - hour: timeSugarDate, - diabtecUnit: measureUnitSelectedType, - measuredTime: measuredTime, - lineItemNo: widget.lineItemNo, - bloodSugerResult: - _bloodSugarValueController.text.toString()); + height: MediaQuery.of(context).size.height * 0.10, + child: Column( + children: [ + FractionallySizedBox( + widthFactor: 0.9, + child: SecondaryButton( + label: TranslationBase.of(context).save.toUpperCase(), + textColor: Colors.white, + color: isButtonDisabled ? Colors.grey[900] : Colors.grey, + onTap: () async { + if (_bloodSugarValueController.text.isNotEmpty) { + if (widget.isUpdate) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.bloodSugarViewMode + .updateDiabtecResult( + month: bloodSugarDate, + hour: timeSugarDate, + diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + lineItemNo: widget.lineItemNo, + bloodSugerResult: + _bloodSugarValueController.text.toString()); - GifLoaderDialogUtils.hideDialog(context); - if (widget.bloodSugarViewMode.state == - ViewState.ErrorLocal) - AppToast.showErrorToast( - message: widget.bloodSugarViewMode.error); - else - Navigator.pop(context); + GifLoaderDialogUtils.hideDialog(context); + if (widget.bloodSugarViewMode.state == + ViewState.ErrorLocal) + AppToast.showErrorToast( + message: widget.bloodSugarViewMode.error); + else + Navigator.pop(context); - } else { - GifLoaderDialogUtils.showMyDialog(context); - await widget.bloodSugarViewMode - .addDiabtecResult( - diabtecUnit: measureUnitSelectedType, - measuredTime: measuredTime, - bloodSugerResult: - _bloodSugarValueController.text.toString(), - bloodSugerDateChart: - '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - ); + } else { + GifLoaderDialogUtils.showMyDialog(context); + await widget.bloodSugarViewMode + .addDiabtecResult( + diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + bloodSugerResult: + _bloodSugarValueController.text.toString(), + bloodSugerDateChart: + '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + ); - GifLoaderDialogUtils.hideDialog(context); - if (widget.bloodSugarViewMode.state == ViewState.Error) - AppToast.showErrorToast( - message: widget.bloodSugarViewMode.error); - else - Navigator.pop(context); + GifLoaderDialogUtils.hideDialog(context); + if (widget.bloodSugarViewMode.state == ViewState.Error) + AppToast.showErrorToast( + message: widget.bloodSugarViewMode.error); + else + Navigator.pop(context); - } + } - } - }), + } + }), + ), + ], ), ), ); From 6ea06ce4424a63904c420d431b1483839c9d22ef Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 8 Aug 2021 14:18:35 +0300 Subject: [PATCH 22/39] PAP-729 --- .../my_trackers/blood_pressure/AddBloodPressurePage.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 98058bcf..e3d59ac4 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State { ), InkWell( onTap: () { - confirmSelectMeasureTimeDialog(!projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); + confirmSelectMeasureTimeDialog(!projectViewModel.isArabic ? measureTimeEnList : measureTimeArList); }, child: Container( padding: EdgeInsets.all(12), From 146fc5d2b290dc56cc4bca9f2cd8f5cda45437dc Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 8 Aug 2021 15:34:38 +0300 Subject: [PATCH 23/39] PAP-777 --- .../medical/reports/report_list_widget.dart | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 922fb239..ece69c0f 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -60,23 +60,29 @@ class ReportListWidget extends StatelessWidget { height: 12, ), Texts(reportList[index].projectName), - Texts(reportList[index].clinicDescription), + Container( + //height: MediaQuery.of(context).size.height * 0.07, + width: MediaQuery.of(context).size.width * 0.35, + child: Texts(reportList[index].clinicDescription), + ), Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'), SizedBox(height: 12), ], ), reportList[index].status == 2 - ? Container( - margin: EdgeInsets.only(left: 15.0, right: 15.0), - child: InkWell( - onTap: () { - showConfirmMessage(reportList[index]); - // sendReportEmail(reportList[index]); - }, - child: Icon( - Icons.email, - color: Theme.of(context).primaryColor, - size: 30.0, + ? Expanded( + child: Container( + margin: EdgeInsets.only(left: 15.0, right: 15.0), + child: InkWell( + onTap: () { + showConfirmMessage(reportList[index]); + // sendReportEmail(reportList[index]); + }, + child: Icon( + Icons.email, + color: Theme.of(context).primaryColor, + size: 30.0, + ), ), ), ) From 7c398ba40d5ab894e156a85c0bced7da993d3ba6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 9 Aug 2021 11:12:42 +0300 Subject: [PATCH 24/39] bug fix --- lib/config/config.dart | 11 +++-- lib/pages/landing/landing_page.dart | 49 ++++++++++--------- lib/pages/login/confirm-login.dart | 4 +- .../bottom_navigation/bottom_nav_bar.dart | 27 +++++----- 4 files changed, 50 insertions(+), 41 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b60a4b07..f8bca863 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -//const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs //const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -124,7 +124,8 @@ const INSERT_ER_INERT_PRES_ORDER = /// ER RRT const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation'; -const GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; +const GET_ALL_RRT_QUESTIONS = + 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; ///FindUs const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; @@ -333,7 +334,7 @@ const IS_DENTAL_ALLOWED_BACKEND = false; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; var DEVICE_TOKEN = ""; -var IS_VOICE_COMMAND_CLOSED = false; +var IS_VOICE_COMMAND_CLOSED = true; var IS_TEXT_COMPLETED = false; var DeviceTypeID = Platform.isIOS ? 1 : 2; const LANGUAGE_ID = 2; @@ -353,7 +354,7 @@ const UPLOAD_INSURANCE_CARD = const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus"; + "Services/Patients.svc/REST/GetApprovalStatus_DWH"; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 9708db83..df0af1f3 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -59,7 +59,7 @@ class LandingPage extends StatefulWidget { @override _LandingPageState createState() => state = _LandingPageState(); - switchToDoFromHMGServices(){ + switchToDoFromHMGServices() { state.changeCurrentTab(4); } } @@ -99,7 +99,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeCurrentTab(int tab) { setState(() { - if(currentTab > 0 && tab == 2) + if (currentTab > 0 && tab == 2) pageController.jumpToPage(0); else if (tab != 0) pageController.jumpToPage(tab); @@ -111,8 +111,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { }); } - - @override void didChangeAppLifecycleState(AppLifecycleState state) { super.didChangeAppLifecycleState(state); @@ -164,9 +162,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); - //setState(() { + AppGlobal.context = context; - // }); + _requestIOSPermissions(); pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); @@ -196,6 +194,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (token != null && DEVICE_TOKEN == "") { DEVICE_TOKEN = token; checkUserStatus(token); + if (projectViewModel.isLogin) + this.getNotificationCount(DEVICE_TOKEN); } }); if (results[Permission.location].isGranted) ; @@ -420,7 +420,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { authService .selectDeviceImei(DEVICE_TOKEN) .then((SelectDeviceIMEIRES value) { - this.getNotificationCount(DEVICE_TOKEN); GifLoaderDialogUtils.hideDialog(context); if (value != null) { setUserValues(value); @@ -444,23 +443,27 @@ class _LandingPageState extends State with WidgetsBindingObserver { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - authService - .registeredAuthenticatedUser(data, token, 0, 0) - .then((res) => {print(res)}); + // authService + // .registeredAuthenticatedUser(data, token, 0, 0) + // .then((res) => {print(res)}); authService.getDashboard().then((value) => { - setState(() { - notificationCount = value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] > - 99 - ? '99+' - : value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] - .toString(); - - sharedPref.setString(NOTIFICATION_COUNT, notificationCount); - }) + if (value != null) + { + setState(() { + notificationCount = value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] > + 99 + ? '99+' + : value['List_PatientDashboard'][0] + ['UnreadPatientNotificationCount'] + .toString(); + + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + }) + } }); - familyFileProvider.getSharedRecordByStatus(); + + // familyFileProvider.getSharedRecordByStatus(); } } } @@ -576,7 +579,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeIndex: changeCurrentTab, index: currentTab, ), - floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked , + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) ? FloatingButton( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 561089ff..bcbcf6cb 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -269,6 +269,7 @@ class _ConfirmLogin extends State { try { availableBiometrics = await auth.getAvailableBiometrics(); } on PlatformException catch (e) { + AppToast.showErrorToast(message: e.message); print(e); } if (!mounted) return; @@ -397,7 +398,8 @@ class _ConfirmLogin extends State { stickyAuth: true, iOSAuthStrings: iosStrings); } on PlatformException catch (e) { - AppToast.showErrorToast(message: e.toString()); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: 'Please enable your Touch or Face ID'); } if (authenticated == true) { diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 76819533..7c0c69d4 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -22,7 +22,9 @@ class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; final int index; final bool showHomeIcon; - BottomNavBar({Key key, this.changeIndex, this.index, this.showHomeIcon = false}) : super(key: key); + BottomNavBar( + {Key key, this.changeIndex, this.index, this.showHomeIcon = false}) + : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); @@ -75,7 +77,7 @@ class _BottomNavBarState extends State { Expanded( child: (widget.showHomeIcon) ? SizedBox( - child: BottomNavigationItem( + child: BottomNavigationItem( icon: Icons.home_outlined, activeIcon: Icons.home_outlined, changeIndex: _changeIndex, @@ -83,7 +85,7 @@ class _BottomNavBarState extends State { currentIndex: 2, name: TranslationBase.of(context).home, ), - ) + ) : SizedBox( height: 50, child: Column( @@ -104,15 +106,16 @@ class _BottomNavBarState extends State { currentIndex: 0, name: TranslationBase.of(context).home, ), - // BottomNavigationItem( - // icon: EvaIcons.calendar, - // activeIcon: EvaIcons.calendar, - // changeIndex: _changeIndex, - // index: _index, - // currentIndex: 2, - // name: TranslationBase.of(context).bookAppo, - // ), - if (/*widget.index == 0 && */projectViewModel.havePrivilege(34)) + // BottomNavigationItem( + // icon: EvaIcons.calendar, + // activeIcon: EvaIcons.calendar, + // changeIndex: _changeIndex, + // index: _index, + // currentIndex: 2, + // name: TranslationBase.of(context).bookAppo, + // ), + if (/*widget.index == 0 && */ projectViewModel + .havePrivilege(34)) BottomNavigationItem( icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, From e5fb16ad69dafc0237e662fbf995d43431717560 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 9 Aug 2021 12:39:50 +0300 Subject: [PATCH 25/39] langauge issue --- lib/pages/DrawerPages/family/my-family.dart | 1 - lib/widgets/drawer/app_drawer_widget.dart | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 32aaaf45..7493dfc1 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -737,7 +737,6 @@ class _MyFamily extends State with TickerProviderStateMixin { } this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setObject(MAIN_USER, mainUser); - this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 73453bf8..c97fdc9a 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -504,7 +504,9 @@ class _AppDrawerState extends State { await authenticatedUserObject.getUser(); _vitalSignService.heightCm = ""; _vitalSignService.weightKg = ""; + var appLanguage = await sharedPref.getString(APP_LANGUAGE); await sharedPref.clear(); + await sharedPref.setString(APP_LANGUAGE, appLanguage); this.user = null; Navigator.of(context).pushNamed(HOME); // projectProvider.platformBridge().unRegisterHmgGeofences(); From 29249dc9a9d9c2b8edca2493fa74c25f25ae047a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 9 Aug 2021 13:34:01 +0300 Subject: [PATCH 26/39] PAP-664 --- .../health_calculator/body_fat/body_fat.dart | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 0ce34e42..a169de0b 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -45,6 +45,10 @@ class _BodyFatState extends State { String dropdownValue; double calories = 0; String textResult = ''; + TextEditingController heightController = TextEditingController(); + TextEditingController neckController = TextEditingController(); + TextEditingController waistController = TextEditingController(); + TextEditingController hipController = TextEditingController(); void updateColorHeight(int type) { //MG/DLT card @@ -310,7 +314,15 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: Text(heightCm.toString()), + child: TextFormField( + keyboardType: TextInputType.number, + controller: heightController, + decoration: InputDecoration( + labelText: heightCm.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), Container( @@ -476,7 +488,15 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: Text(neck.toString()), + child: TextFormField( + keyboardType: TextInputType.number, + controller: neckController, + decoration: InputDecoration( + labelText: neck.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), Container( @@ -642,7 +662,15 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: Text(waist.toString()), + child: TextFormField( + keyboardType: TextInputType.number, + controller: waistController, + decoration: InputDecoration( + labelText: waist.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), Container( @@ -808,7 +836,15 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: Text(hip.toString()), + child: TextFormField( + keyboardType: TextInputType.number, + controller: hipController, + decoration: InputDecoration( + labelText: hip.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), Container( From 352fd912de1acbbfcfe7ad5eae8a43fe7c1faa47 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 9 Aug 2021 14:05:49 +0300 Subject: [PATCH 27/39] PAP-664 --- .../health_calculator/body_fat/body_fat.dart | 76 +++++++++++-------- 1 file changed, 44 insertions(+), 32 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index a169de0b..7f0d0c5c 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -314,14 +314,17 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: TextFormField( - keyboardType: TextInputType.number, - controller: heightController, - decoration: InputDecoration( - labelText: heightCm.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), + child: Padding( + padding: const EdgeInsets.only(left: 10.0), + child: TextFormField( + keyboardType: TextInputType.number, + controller: heightController, + decoration: InputDecoration( + labelText: heightCm.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), ), @@ -488,14 +491,17 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: TextFormField( - keyboardType: TextInputType.number, - controller: neckController, - decoration: InputDecoration( - labelText: neck.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), + child: Padding( + padding: const EdgeInsets.only(left: 10.0), + child: TextFormField( + keyboardType: TextInputType.number, + controller: neckController, + decoration: InputDecoration( + labelText: neck.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), ), @@ -662,14 +668,17 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: TextFormField( - keyboardType: TextInputType.number, - controller: waistController, - decoration: InputDecoration( - labelText: waist.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), + child: Padding( + padding: const EdgeInsets.only(left: 10.0), + child: TextFormField( + keyboardType: TextInputType.number, + controller: waistController, + decoration: InputDecoration( + labelText: waist.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), ), @@ -836,14 +845,17 @@ class _BodyFatState extends State { children: [ Expanded( child: Center( - child: TextFormField( - keyboardType: TextInputType.number, - controller: hipController, - decoration: InputDecoration( - labelText: hip.toString(), - labelStyle: TextStyle( - color: Colors.black, - )), + child: Padding( + padding: const EdgeInsets.only(left: 10.0), + child: TextFormField( + keyboardType: TextInputType.number, + controller: hipController, + decoration: InputDecoration( + labelText: hip.toString(), + labelStyle: TextStyle( + color: Colors.black, + )), + ), ), ), ), From 02df6f4d853281068b75c77e1c39c184fd4d7028 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 9 Aug 2021 14:29:32 +0300 Subject: [PATCH 28/39] PAP-664 --- .../my_trackers/blood_pressure/AddBloodPressurePage.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 37eb3529..1b8f70e3 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -235,7 +235,8 @@ class _AddBloodPressurePageState extends State { textColor: Colors.white, color: isButtonDisabled ? Colors.grey[900] : Colors.grey, onTap: () async { - if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { + if (_bloodSystolicValueController.text.isNotEmpty && + _bloodDiastolicValueController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.model From 50070641053a361458939a84d6f52db5fc8dcbd9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 9 Aug 2021 17:17:22 +0300 Subject: [PATCH 29/39] Jira fixes --- .../components/SearchByDoctor.dart | 11 ++++-- .../MyAppointments/AppointmentDetails.dart | 38 ++++++++++++++----- .../appointment_services/GetDoctorsList.dart | 2 +- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 5b4f6dc3..3289fd74 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -19,6 +19,7 @@ class _SearchByDoctorState extends State { @override void initState() { + super.initState(); _isButtonDisabled = true; } @@ -120,11 +121,15 @@ class _SearchByDoctorState extends State { _patientDoctorAppointmentListHospital.add( PatientDoctorAppointmentList( filterName: element.projectName, - distanceInKMs: element.projectDistanceInKiloMeters.toString(), + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); - } else {} + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: res['ErrorSearchMsg']); + } }); GifLoaderDialogUtils.hideDialog(context); navigateToSearchResults( @@ -167,7 +172,7 @@ class _SearchByDoctorState extends State { context, FadePage( page: SearchResults( - isLiveCareAppointment: false, + isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))); diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 9848b394..f0791d02 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -39,10 +39,10 @@ class _AppointmentDetailsState extends State void initState() { _tabController = new TabController(length: 2, vsync: this); AppointmentDetails.showFooterButton = false; + print(widget.appo.clinicID); super.initState(); } - @override void dispose() { super.dispose(); @@ -116,7 +116,8 @@ class _AppointmentDetailsState extends State Container( margin: EdgeInsets.only(top: 10.0), alignment: Alignment.center, - child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), + child: Text( + getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle( fontSize: 12.0, color: Colors.grey[900], @@ -177,20 +178,37 @@ class _AppointmentDetailsState extends State TabBar( onTap: (index) { setState(() { - index == 1 - ? AppointmentDetails.showFooterButton = true - : AppointmentDetails.showFooterButton = false; - print(AppointmentDetails.showFooterButton); + // index == 1 + // ? AppointmentDetails.showFooterButton = true + // : AppointmentDetails.showFooterButton = false; + + if (index == 1) { + if (widget.appo.clinicID == 17 || + widget.appo.clinicID == 23) { + _tabController.index = + _tabController.previousIndex; + AppointmentDetails.showFooterButton = false; + } else { + AppointmentDetails.showFooterButton = true; + } + } }); }, tabs: [ Tab( child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), - Tab( - child: Text(TranslationBase.of(context).availableAppo, - style: TextStyle(color: Colors.black)), - ) + widget.appo.clinicID == 17 || widget.appo.clinicID == 23 + ? Tab( + child: Text( + TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.grey)), + ) + : Tab( + child: Text( + TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.black)), + ) ], controller: _tabController, ), diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 7ca568ae..fb55d538 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -116,7 +116,7 @@ class DoctorsListService extends BaseService { "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": authUser.outSA, + "PatientOutSA": authProvider.isLogin ? authUser.outSA : false, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, "SessionID": null, From 90db04cee1be9c04687770d99424e046534c5e63 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 10 Aug 2021 16:30:01 +0300 Subject: [PATCH 30/39] Jira Fixes --- lib/config/localized_values.dart | 2 +- .../service/medical/radiology_service.dart | 2 +- .../LiveCare/LiveCareClinicsListResponse.dart | 4 +- .../all_habib_medical_service_page.dart | 47 +++++++++++++++---- lib/pages/BookAppointment/DoctorProfile.dart | 9 ++++ .../MyAppointments/AppointmentDetails.dart | 19 ++++---- .../MyAppointments/models/ArrivedButtons.dart | 2 +- .../insurance_card_update_details.dart | 1 + lib/pages/landing/home_page.dart | 2 +- lib/pages/livecare/widgets/clinic_card.dart | 4 +- lib/pages/livecare/widgets/clinic_list.dart | 11 +++-- lib/pages/login/forgot-password.dart | 5 +- .../radiology/radiology_details_page.dart | 1 + .../vital_sign/vital_sign_details_screen.dart | 2 +- .../medical/vital_sign/vital_sign_item.dart | 2 +- 15 files changed, 79 insertions(+), 34 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 748efe62..50d4b4c6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1493,7 +1493,7 @@ const Map localizedValues = { "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" }, "scan-now": { - "en": "If you have a card / Document Scan now", + "en": "If you have a card/Document Scan now", "ar": "إذا كانت لديك بطاقة / مستند ارفقها الان" }, "liveCare": {"en": "Live Care", "ar": "لايف كير"}, diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index b0b96e71..965fa752 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -11,7 +11,7 @@ class RadiologyService extends BaseService { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; - body['LineIt emNo'] = lineItem; + body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; await baseAppClient.post(GET_RAD_IMAGE_URL, diff --git a/lib/models/LiveCare/LiveCareClinicsListResponse.dart b/lib/models/LiveCare/LiveCareClinicsListResponse.dart index 094fb1a5..421f202f 100644 --- a/lib/models/LiveCare/LiveCareClinicsListResponse.dart +++ b/lib/models/LiveCare/LiveCareClinicsListResponse.dart @@ -35,10 +35,10 @@ class PatientERGetClinicsList { String createdOn; String createdBy; int isOnline; - Null endTime; + dynamic endTime; bool projectOutSA; List shiftTimings; - Null startTime; + dynamic startTime; PatientERGetClinicsList( {this.iD, diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 355300c4..c4c5d5d6 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/weather_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; @@ -15,13 +17,15 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dar import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; -import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; @@ -50,9 +54,13 @@ class AllHabibMedicalService extends StatefulWidget { class _AllHabibMedicalServiceState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); LocationUtils locationUtils; var weather = '--'; WeatherService _weatherService = WeatherService(); + @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { @@ -232,12 +240,13 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).emergencyService, ), ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ), + onTap: () => getPharmacyToken(), + // Navigator.push( + // context, + // FadePage( + // page: ParkingPage(), + // ), + // ), imageLocation: 'assets/images/pharmacy_logo.png', title: TranslationBase.of(context).pharmacy), ServicesContainer( @@ -254,8 +263,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage( - page: EReferralPage()), + FadePage(page: EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', title: TranslationBase.of(context).ereferral, @@ -282,7 +290,7 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).childVaccine, ), ServicesContainer( - onTap: (){ + onTap: () { Navigator.pop(context); LandingPage.shared.switchToDoFromHMGServices(); }, @@ -401,6 +409,25 @@ class _AllHabibMedicalServiceState extends State { ); } + getPharmacyToken() async { + if (!authProvider.isLogin) { + Navigator.push(context, FadePage(page: LandingPagePharmacy())); + } else { + GifLoaderDialogUtils.showMyDialog(context); + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if (pharmacyModuleViewModel.error.isNotEmpty) { + await pharmacyModuleViewModel.createUser().then((value) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, FadePage(page: LandingPagePharmacy())); + }); + } else { + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, FadePage(page: LandingPagePharmacy())); + } + }); + } + } + getAuthUser() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson( diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 2a349cf2..fd89889f 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -121,6 +121,15 @@ class _DoctorProfileState extends State color: Colors.grey[900], letterSpacing: 1.0)), ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(widget.doctor.projectName, + style: TextStyle( + fontSize: 15.0, + color: Colors.grey[900], + letterSpacing: 1.0)), + ), Container( margin: EdgeInsets.only(top: 10.0), alignment: Alignment.center, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index f0791d02..68781795 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -178,13 +178,10 @@ class _AppointmentDetailsState extends State TabBar( onTap: (index) { setState(() { - // index == 1 - // ? AppointmentDetails.showFooterButton = true - // : AppointmentDetails.showFooterButton = false; - if (index == 1) { if (widget.appo.clinicID == 17 || - widget.appo.clinicID == 23) { + widget.appo.clinicID == 23 || + widget.appo.isExecludeDoctor) { _tabController.index = _tabController.previousIndex; AppointmentDetails.showFooterButton = false; @@ -198,12 +195,14 @@ class _AppointmentDetailsState extends State Tab( child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), - widget.appo.clinicID == 17 || widget.appo.clinicID == 23 + widget.appo.clinicID == 17 || + widget.appo.clinicID == 23 || + widget.appo.isExecludeDoctor ? Tab( - child: Text( - TranslationBase.of(context).availableAppo, - style: TextStyle(color: Colors.grey)), - ) + child: Text( + TranslationBase.of(context).availableAppo, + style: TextStyle(color: Colors.grey)), + ) : Tab( child: Text( TranslationBase.of(context).availableAppo, diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index 136bd30f..dc3ff3f9 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -30,7 +30,7 @@ class ArrivedButtons { { "title": TranslationBase.of(AppGlobal.context).raise, "subtitle": TranslationBase.of(AppGlobal.context).complaint, - "icon": "assets/images/new-design/Complaint_icon.png", + "icon": "assets/images/new-design/feedback_icon.png", "caller": "insertComplaint" }, { diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index 5e9db38a..87035e0c 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -264,6 +264,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { textColor: Colors.white, label: TranslationBase.of(context).scanNow.toUpperCase(), color: Theme.of(context).primaryColor, + small: true, onTap: () async { confirmAttachInsuranceCardImageDialogDialog( context: context, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 3f25217c..58829bb5 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -785,7 +785,7 @@ class _HomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).contactUs, + TranslationBase.of(context).reachUs, color: Colors.white, fontWeight: FontWeight.normal, ), diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 9ea12f01..0d9f056c 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -12,10 +12,12 @@ class ClinicCard extends StatefulWidget { bool isSelected; final PatientERGetClinicsList patientERGetClinicsList; var languageID; + int isOnline; ClinicCard( {this.isSelected, this.languageID, + this.isOnline, @required this.patientERGetClinicsList}); @override @@ -37,7 +39,7 @@ class _State extends State { children: [ Card( margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), - color: widget.isSelected ? Colors.blue : Colors.white, + color: widget.isSelected ? Colors.blue : widget.isOnline == 1 ? Colors.white : Colors.grey, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index ae7f1dca..0e8c64f1 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -385,7 +385,7 @@ class _clinic_listState extends State { } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + // AppToast.showErrorToast(message: err); print(err); }); } @@ -555,8 +555,13 @@ class _clinic_listState extends State { itemBuilder: (context, index) { return InkWell( onTap: () { - updateSelectedIndex(liveCareClinicsListResponse - .patientERGetClinicsList[index]); + if(liveCareClinicsListResponse + .patientERGetClinicsList[index].isOnline == 1) { + updateSelectedIndex(liveCareClinicsListResponse + .patientERGetClinicsList[index]); + } else { + AppToast.showErrorToast(message: "Clinic is offline"); + } }, child: ClinicCard( isSelected: selectedClinicID == diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index 0bc93081..e1db8730 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -23,6 +23,7 @@ class _ForgotPassword extends State { final TextEditingController nationalIDorFile = null; String mobileNo = ""; var con; + @override Widget build(BuildContext context) { con = context; @@ -76,8 +77,8 @@ class _ForgotPassword extends State { child: DefaultButton( TranslationBase.of(context).submit, () { - sendPatientIDBySMS(); -// print(mobileNo.text); + if (mobileNo.length >= 9 == true) + sendPatientIDBySMS(); }, color: mobileNo.length >= 9 == true ? Colors.grey[900] diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 742e3ddf..9d5afd8f 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -71,6 +71,7 @@ class RadiologyDetailsPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () { + print(model.radImageURL); launch(model.radImageURL); }, label: TranslationBase.of(context).openRad, diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index 4d141b5f..9f7b0f6d 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -163,7 +163,7 @@ class VitalSignDetailsScreen extends StatelessWidget { des: TranslationBase.of(context).respirationRate, icon: DQIcons.outline, lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context).respirationSigns, + unit: TranslationBase.of(context).bpm, ), ), ], diff --git a/lib/pages/medical/vital_sign/vital_sign_item.dart b/lib/pages/medical/vital_sign/vital_sign_item.dart index fb44772d..1cad714e 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -78,7 +78,7 @@ class VitalSignItem extends StatelessWidget { children: [ TextSpan(text: lastVal), TextSpan( - text: unit, + text: " " + unit, style: TextStyle( color: HexColor('#B8382C'), ), From 97d7f9225e6420cfff32ef9caae48e90bb86c2f4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 10 Aug 2021 17:15:08 +0300 Subject: [PATCH 31/39] package name changed --- android/app/build.gradle | 8 +++++--- android/app/google-services.json | 2 +- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- .../com/cloud/diplomaticquarterapp/MainActivity.kt | 4 ++-- .../diplomaticquarterapp/geofence/GeoZoneModel.kt | 2 +- .../diplomaticquarterapp/geofence/HMG_Geofence.kt | 8 ++++---- .../intent_receivers/GeofenceBroadcastReceiver.kt | 8 ++++---- .../GeofenceBroadcastReceiverWithJobService.kt | 4 ++-- .../intent_receivers/GeofenceErrorMessages.kt | 6 +++--- .../GeofenceTransitionsJobIntentService.kt | 8 ++++---- .../GeofencingRebootBroadcastReceiver.kt | 6 +++--- .../LocationProviderChangeReceiver.kt | 8 ++++---- .../intent_receivers/ReregisterGeofenceJobService.kt | 6 +++--- .../cloud/diplomaticquarterapp/hmgwifi/HMG_Guest.kt | 8 ++++---- .../diplomaticquarterapp/hmgwifi/HMG_Internet.kt | 8 ++++---- .../com/cloud/diplomaticquarterapp/hmgwifi/WPA.kt | 6 +++--- .../com/cloud/diplomaticquarterapp/utils/API.kt | 2 +- .../cloud/diplomaticquarterapp/utils/Constants.kt | 2 +- .../cloud/diplomaticquarterapp/utils/FlutterText.kt | 2 +- .../com/cloud/diplomaticquarterapp/utils/HMGUtils.kt | 10 +++++----- .../cloud/diplomaticquarterapp/utils/HMG_Wifi_.kt | 6 +++--- .../com/cloud/diplomaticquarterapp/utils/Logs.kt | 4 ++-- .../diplomaticquarterapp/utils/PlatformBridge.kt | 12 ++++++------ android/app/src/profile/AndroidManifest.xml | 2 +- lib/config/config.dart | 4 ++-- lib/services/authentication/auth_provider.dart | 7 +++++-- 27 files changed, 76 insertions(+), 71 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 336e8e53..5fd11eb3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -34,13 +34,15 @@ android { } lintOptions { - disable 'InvalidPackage' + disable 'MissingTranslation' + checkReleaseBuilds false + } + defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). -// applicationId "com.cloud.diplomaticquarterapp" - applicationId "com.ejada.hmg.uat" + applicationId "com.ejada.hmg" minSdkVersion 21 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() diff --git a/android/app/google-services.json b/android/app/google-services.json index 6d1d75a9..dd4038cf 100755 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -10,7 +10,7 @@ "client_info": { "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", "android_client_info": { - "package_name": "com.ejada.hmg.uat" + "package_name": "com.ejada.hmg" } }, "oauth_client": [ diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index d8fd4e88..ab5e631b 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.ejada.hmg"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 63f94294..b90d91e3 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.ejada.hmg"> diff --git a/lib/config/config.dart b/lib/config/config.dart index f8bca863..1a309e96 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs //const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 3ad128d4..926ee2bc 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -117,8 +117,10 @@ class AuthProvider with ChangeNotifier { var imei = await sharedPref.getString(PUSH_TOKEN); // if (!request.) { newRequest.iMEI = imei; //imei!=null ? imei : ''; - newRequest.firstName = request.firstName??"" + " " + request.lastName??""; - newRequest.firstNameN = request.firstNameN??"" + " " + request.lastNameN??""; + newRequest.firstName = + request.firstName ?? "" + " " + request.lastName ?? ""; + newRequest.firstNameN = + request.firstNameN ?? "" + " " + request.lastNameN ?? ""; newRequest.lastNameN = request.lastNameN ?? ""; newRequest.outSA = request.outSA == 1 ? true : false; newRequest.biometricEnabled = false; @@ -325,6 +327,7 @@ class AuthProvider with ChangeNotifier { request['DeviceTypeID'] = DeviceTypeID; request['LanguageID'] = LANGUAGE_ID; var requestN = RegisterUserRequest.fromJson(request); + requestN.patientOutSA = requestN.patientobject.patientOutSA; // request.tokenID = ''; dynamic localRes; try { From bf303a7be065c257b065325dd2b297cbfbf9493d Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Tue, 10 Aug 2021 17:48:27 +0300 Subject: [PATCH 32/39] RRT Implementation --- lib/config/localized_values.dart | 21 ++ lib/core/model/pharmacies/Addresses.dart | 5 + .../prescriptions/prescriptions_order.dart | 16 ++ lib/core/service/client/base_app_client.dart | 1 + lib/core/viewModels/er/rrt-view-model.dart | 128 ++++++++---- lib/core/viewModels/project_view_model.dart | 7 +- lib/models/rrt/service_price.dart | 53 +++++ .../rrt-agreement-page.dart | 49 +++++ .../rapid-response-team/rrt-logs-page.dart | 96 +++------ .../rapid-response-team/rrt-main-screen.dart | 47 ++++- .../rrt-order-list-item.dart | 71 +++++++ .../rrt-pickup-address-page.dart | 171 +++++++++++----- .../rapid-response-team/rrt-place-order.dart | 191 ++++++++++++++++++ .../rapid-response-team/rrt-request-page.dart | 169 +++++++++++----- lib/pages/login/forgot-password.dart | 2 +- lib/pages/login/register.dart | 4 +- .../pharmacyAddress_service.dart | 14 +- lib/uitl/HMGNetworkConnectivity.dart | 2 +- lib/uitl/translations_delegate_base.dart | 6 + lib/uitl/utils.dart | 2 +- lib/widgets/dialogs/alert_dialog.dart | 19 +- 21 files changed, 834 insertions(+), 240 deletions(-) create mode 100644 lib/models/rrt/service_price.dart create mode 100644 lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart create mode 100644 lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart create mode 100644 lib/pages/ErService/rapid-response-team/rrt-place-order.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 18790bd4..681e0b22 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1269,10 +1269,31 @@ const Map localizedValues = { "TaxAmount": {"en": "Tax Amount:", "ar": "Tax Amount:"}, "TotalAmountPayable": {"en": "Total Amount Payable:", "ar": "Total Amount Payable:"}, "iAcceptTermsConditions": {"en": "I Accept the Terms And Conditions", "ar": "You can pay by the following options:"}, + "somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"}, "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "I Accept the Terms And Conditions"}, "RRTDDetails": {"en": "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home", "ar": "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home"}, "Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"}, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, + "rrtUserAgreementTitle":{ + "en":"Communication via email, text messages and phone calls", + "ar":"الاتصال عبر البريد الإلكتروني، والرسائل النصية، والمكالمات الهاتفية" + }, + "rrtUserAgreementP1":{ + "en" : "I understand that the contact number or Email that I have provided on registration will be used for communication by HMG. I hereby agree to be notified by HMG through SMS, Email or any other method for appointments notifications, current HMG’s medical services, and any services introduced by the HMG in the future or any modifications made to the services offered by the HMG. And these messages may be submitted as evidence where the HMG has the right to use at any time whatsoever and as it sees fit.", + "ar" : "أدرك بأن رقم الهاتف أو البريد الإلكتروني الذي قدمته للمجموعة سيستخدم كوسيلة اتصال بيني وبينها، وأقر بموافقتي على قيام المجموعة بإخطاري عن طريق الرسائل القصيرة أو البريد الإلكتروني أو أي طريقة أخرى بالمواعيد وبأي خدمات طبية تقدمها المجموعة أو قد تطرحها المجموعة للجمهور في المستقبل أو أي تعديلات قد تطرأ على الخدمات المقدمة من قبل المجموعة. وتعتبر هذه الرسائل دليل إثبات يحق للمجموعة استخدامه في أي وقت تشاء. " + }, + "rrtUserAgreementP2":{ + "en":"I understand the risks of communicating by email and text messages, in particular the privacy risks. I understand that HMG cannot guarantee the security and confidentiality of email or text communication. HMG will not be responsible for messages that are not received or delivered due to technical failure, or for disclosure of confidential information unless caused by intentional misconduct.", + "ar":"أفھم مخاطر التواصل عبر البرید الإلکتروني والرسائل النصیة، خاصة مخاطر الخصوصیة، وادرك أن المجموعة لا يمكنها ضمان أمن وسرية البريد الإلكتروني أو الرسائل النصية ولن تكون المجموعة مسؤولة عن الرسائل التي لم يتم استلامها أو تسليمها بسبب الفشل التقني أو الكشف عن المعلومات السرية ما لم يكن سببها سوء سلوك متعمد." + }, + "rrtUserAgreementP3":{ + "en":'I hereby agree to receive emails, text messages, phone calls for appointments notifications, special promotions and new features or products introduced by HMG or any third party.', + "ar":"وافق على تلقي رسائل البريد الإلكتروني، والرسائل النصية، والمكالمات الهاتفية للإخطار بالمواعيد والعروض الترويجية والمميزات والمنتجات الجديدة الخاصة بالمجموعة أو اي طرف اخر." + }, + "rrtOrderSuccessMessage": { + "en": "The request has been sent successfully, You will be contacted soon.", + "ar": "تم ارسال الطلب بنجاح وسيتم الاتصال بك قريبا." + }, "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, "directions": {"en": "Directions", "ar": "الاتجاهات"}, diff --git a/lib/core/model/pharmacies/Addresses.dart b/lib/core/model/pharmacies/Addresses.dart index b00b1a17..40bcb778 100644 --- a/lib/core/model/pharmacies/Addresses.dart +++ b/lib/core/model/pharmacies/Addresses.dart @@ -86,4 +86,9 @@ class Addresses { return data; } + @override + String toString() { + return "${address1 ?? ""} ${address2 ?? ""}"; + } + } diff --git a/lib/core/model/prescriptions/prescriptions_order.dart b/lib/core/model/prescriptions/prescriptions_order.dart index fdcbf203..d3390d92 100644 --- a/lib/core/model/prescriptions/prescriptions_order.dart +++ b/lib/core/model/prescriptions/prescriptions_order.dart @@ -1,4 +1,7 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class PrescriptionsOrder { int iD; @@ -32,6 +35,19 @@ class PrescriptionsOrder { dynamic projectDescription; dynamic projectDescriptionN; + String getNearestProjectDescription(){ + return isAppArabic ? nearestProjectDescriptionN : nearestProjectDescription; + } + String getStatusName(TranslationBase localize){ + if(status == 1) + return localize.pending; + else if(status == 3) + return localize.completed; + return '$status'; + } + + String getFormattedDateTime()=> DateUtil.getDateFormatted(pickupDateTime); + PrescriptionsOrder( {this.iD, this.patientID, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 03f12df1..42dc2f4b 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -169,6 +169,7 @@ class BaseAppClient { } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); + debugPrint(parsed.toString()); } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index 975b01a1..1289538d 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -1,7 +1,19 @@ +import 'dart:async'; +import 'dart:convert'; + import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; +import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/cupertino.dart'; import '../base_view_model.dart'; @@ -9,91 +21,127 @@ import '../base_view_model.dart'; class RRTService extends BaseService{ } -class _RRTServiceOrders{ +class _RRTServiceData{ List pendingOrders = []; List completedOrders = []; + ServicePrice servicePrice; } class RRTViewModel extends BaseViewModel{ var _service = RRTService(); - _RRTServiceOrders rrtOrders = _RRTServiceOrders(); - - Future getRequiredData() async{ - getServicePrice(); - getAllOrders(); + var _pharmacy_service = locator(); + var _pharmacy_address_service = locator(); + + _RRTServiceData rrtServiceData = _RRTServiceData(); + + Future<_RRTServiceData> loadRequiredData() async{ + await getServicePrice(); + await getAllOrders(); + return rrtServiceData; } - Future createOrder(){ - var body = {"Latitude":24.828170776367188,"Longitude":46.63229029757938,"IdentificationNo":"2344670985","NationalityID":"JOR","CreatedBy":1231755,"OrderServiceID":5,"Notes":""}; - _service.baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, body: body, onSuccess: (response, statusCode){ - print(response); - }, onFailure: (error, statusCode){ + Future createOrder(Map body) async{ + body['IdentificationNo'] = user.patientIdentificationNo; + body['NationalityID'] = user.nationalityID; + body['CreatedBy'] = user.patientIdentificationType; + body['OrderServiceID'] = 5; + int requestNo; + await _service.baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, body: body, onSuccess: (response, statusCode){ + requestNo = response['RequestNo']; + }, onFailure: (error, statusCode){ + AppToast.showErrorToast(message: error); }); - return null; + return requestNo; } // Service ID: 4 == RRT - Future<_RRTServiceOrders> getAllOrders() async{ + Future<_RRTServiceData> getAllOrders() async{ await _service.baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, body: {}, onSuccess: (response, statusCode){ var data = response["PatientER_GetPatientAllPresOrdersList"]; if(data != null && data is List){ data.forEach((json){ - if(json["ServiceID"] == 4){ + if(json["ServiceID"] == 5){ if(json["Status"] == 1){ // Pending - rrtOrders.pendingOrders.clear(); - rrtOrders.pendingOrders.add(PrescriptionsOrder.fromJson(json)); + rrtServiceData.pendingOrders.clear(); + rrtServiceData.pendingOrders.add(PrescriptionsOrder.fromJson(json)); }else if (json["Status"] == 3){ // Completed - rrtOrders.completedOrders.clear(); - rrtOrders.completedOrders.add(PrescriptionsOrder.fromJson(json)); + rrtServiceData.completedOrders.clear(); + rrtServiceData.completedOrders.add(PrescriptionsOrder.fromJson(json)); } } + return Future.error("404"); }); } }, onFailure: (error, statusCode){ - print(error); + AppToast.showErrorToast(message: error); }); - return rrtOrders; + return rrtServiceData; } - Future getOrderDetails(){ - + Future getOrderDetails() async{ return null; } - Future getAllQuestions(){ - _service.baseAppClient.post(GET_ALL_RRT_QUESTIONS, body: {}, onSuccess: (response, statusCode){ - print(response); + Future getAllQuestions() async{ + dynamic response_; + await _service.baseAppClient.post(GET_ALL_RRT_QUESTIONS, body: {}, onSuccess: (response, statusCode){ + response_ = response; }, onFailure: (error, statusCode){ - print(error); + AppToast.showErrorToast(message: error); }); - return null; + return response_; } - Future getServicePrice(){ - var body = {"IdentificationNo":user.patientIdentificationNo}; - _service.baseAppClient.post(GET_RRT_SERVICE_PRICE, body: body, onSuccess: (response, statusCode){ - print(response); + Future getServicePrice() async{ + Map body = {"IdentificationNo":user.patientIdentificationNo}; + ServicePrice servicePrice; + await _service.baseAppClient.post(GET_RRT_SERVICE_PRICE, body: body, onSuccess: (response, statusCode){ + var data = response['PatientE_RealRRT_GetServicePriceList']; + if(data != null && data is List){ + var priceData = data.first; + if(priceData != null){ + servicePrice = ServicePrice.fromJson(priceData); + rrtServiceData.servicePrice = servicePrice; + } + } }, onFailure: (error, statusCode){ - print(error); + AppToast.showErrorToast(message: error); }); - return null; + return servicePrice; } - Future cancelOrder(){ - var body = {"PresOrderID":"2318","PresOrderStatus":4,"EditedBy":3,"RejectionReason":""}; - _service.baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, body: body, onSuccess: (response, statusCode){ - print(response); + Future cancelOrder(PrescriptionsOrder order, {String reason = ""}) async{ + var body = {"PresOrderID":order.iD, "PresOrderStatus":4,"EditedBy":3,"RejectionReason":reason}; + var success = false; + await _service.baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, body: body, onSuccess: (response, statusCode){ + success = true; }, onFailure: (error, statusCode){ - print(error); + AppToast.showErrorToast(message: error); + success = false; }); - return null; + return Future.value(success); } - Future getCancelReasons(){ } + + Future> getAddresses() async{ + Object error; + try{ + var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); + if(token == null) + await _pharmacy_service.generatePharmacyToken(); + + await _pharmacy_service.makeVerifyCustomer({'PatientID': user.patientID.toString()}); + await _pharmacy_address_service.getAddresses(); + return _pharmacy_address_service.addresses; + }catch(e){ + error = e; + } + Future.error(error); + } } \ No newline at end of file diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 17ccb267..2e6d1f29 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +var isAppArabic = false; class ProjectViewModel extends BaseViewModel { // Platform Bridge PlatformBridge platformBridge() { @@ -69,19 +70,19 @@ class ProjectViewModel extends BaseViewModel { currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _appLocale = Locale(currentLanguage); - _isArabic = currentLanguage == 'ar'; + isAppArabic = _isArabic = currentLanguage == 'ar'; notifyListeners(); } void changeLanguage(String lan) { if (lan != "en" && currentLanguage != lan) { _appLocale = Locale("ar"); - _isArabic = true; + isAppArabic = _isArabic = true; currentLanguage = 'ar'; sharedPref.setString(APP_LANGUAGE, 'ar'); } else if (lan != "ar" && currentLanguage != lan) { _appLocale = Locale("en"); - _isArabic = false; + isAppArabic = _isArabic = false; currentLanguage = 'en'; sharedPref.setString(APP_LANGUAGE, 'en'); } diff --git a/lib/models/rrt/service_price.dart b/lib/models/rrt/service_price.dart new file mode 100644 index 00000000..d206c986 --- /dev/null +++ b/lib/models/rrt/service_price.dart @@ -0,0 +1,53 @@ +class ServicePrice { + String currency; + double maxPrice; + double maxTotalPrice; + double maxVAT; + double minPrice; + double minTotalPrice; + double minVAT; + int price; + int totalPrice; + int vat; + + ServicePrice({ + this.currency, + this.maxPrice, + this.maxTotalPrice, + this.maxVAT, + this.minPrice, + this.minTotalPrice, + this.minVAT, + this.price, + this.totalPrice, + this.vat}); + + ServicePrice.fromJson(dynamic json) { + currency = json["Currency"]; + maxPrice = json["MaxPrice"]; + maxTotalPrice = json["MaxTotalPrice"]; + maxVAT = json["MaxVAT"]; + minPrice = json["MinPrice"]; + minTotalPrice = json["MinTotalPrice"]; + minVAT = json["MinVAT"]; + price = json["Price"]; + totalPrice = json["TotalPrice"]; + vat = json["VAT"]; + } + + Map toJson() { + var map = {}; + map["Currency"] = currency; + map["MaxPrice"] = maxPrice; + map["MaxTotalPrice"] = maxTotalPrice; + map["MaxVAT"] = maxVAT; + map["MinPrice"] = minPrice; + map["MinTotalPrice"] = minTotalPrice; + map["MinVAT"] = minVAT; + map["Price"] = price; + map["TotalPrice"] = totalPrice; + map["VAT"] = vat; + return map; + } + +} \ No newline at end of file diff --git a/lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart b/lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart new file mode 100644 index 00000000..c3048127 --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart @@ -0,0 +1,49 @@ +import 'package:diplomaticquarterapp/pages/conference/clipped_video.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class RRTAgreementPage extends StatelessWidget{ + TranslationBase localize; + + @override + Widget build(BuildContext context) { + localize = TranslationBase.of(context); + + return AppScaffold( + appBarTitle: localize.userAgreement, + isShowAppBar: true, + showHomeAppBarIcon: false, + body: SingleChildScrollView( + padding: EdgeInsets.all(20), + child: Column( + children: [ + Text(localize.rrtUserAgreementTitle, style: TextStyle(color: Colors.black, fontWeight: FontWeight.w500, fontSize: 22), maxLines: 100, textAlign: TextAlign.center), + SizedBox(height: 20), + text(localize.rrtUserAgreementP1), + text(localize.rrtUserAgreementP2), + text(localize.rrtUserAgreementP3) + ], + ), + ) + ); + } + + Widget text(String string)=> Padding( + padding: const EdgeInsets.symmetric(vertical: 15), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + clipBehavior: Clip.hardEdge, + width: 10, height: 10, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: Colors.black) + ), + SizedBox(width: 20), + Expanded(child: Text(string, style: TextStyle(color: Colors.black87, fontSize: 18), maxLines: 100, textAlign: TextAlign.justify)), + ], + ), + ); + +} \ No newline at end of file diff --git a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart index acfe13d8..59f11fb2 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart @@ -1,94 +1,54 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RRTLogPage extends StatefulWidget{ + final List orders; + const RRTLogPage({this.orders}); + @override State createState() => RRTLogPageState(); } class RRTLogPageState extends State{ + + RRTViewModel viewModel; + @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (viewModel){ - }, - builder: (ctx, vm, widget){ + return BaseView( + onModelReady: (vm) => viewModel = vm, + builder: (ctx, vm, widgetState){ return ListView.builder( - itemCount: 10, - itemBuilder: (ctx, idx) => RRTLogListItem() + itemCount: widget.orders.length, + itemBuilder: (ctx, idx) { + var order = widget.orders[idx]; + return RRTLogListItem(order, onCancel: deleteOrder); + } ); } ); } -} - - - -// ------------------------ -// List Item Widget -// ------------------------ - - -final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); - -class RRTLogListItem extends StatelessWidget{ - BuildContext _context; - @override - Widget build(BuildContext context) { - _context = context; - - return Container( - padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15), - boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)] - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - _contentItem(label: "Request ID", value: "2318"), - _item_content_seperator, - _contentItem(label: "Status", value: "2318"), - _item_content_seperator, - _contentItem(label: "Pickup Date", value: "2318"), - _item_content_seperator, - _contentItem(label: "Location", value: "2318"), - _item_content_seperator, - SizedBox(height: 10), - FractionallySizedBox(child: cancelButton()) - ], - ), - ); - } - - Widget _contentItem({@required String label, String value}){ - return Container( - padding: EdgeInsets.symmetric(vertical: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),), - SizedBox(height: 5,), - Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),), - ], - ), - ); + deleteOrder(PrescriptionsOrder order) async { + GifLoaderDialogUtils.showMyDialog(context); + var success = await viewModel.cancelOrder(order); + GifLoaderDialogUtils.hideDialog(context); + if(success) + setState(() { + widget.orders.remove(order); + }); } - Widget cancelButton() => MaterialButton( - height: 45, - color: Color(0xFFc5272d), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), - onPressed: () { }, - child: Text("CANCEL", style: TextStyle(color: Colors.white, fontSize: 13),), - - ); } + diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index fe1c6a9d..905d0810 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -1,6 +1,9 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,27 +19,55 @@ class RRTMainScreenState extends State with SingleTickerProvider TabController tabController; PageController pageController = PageController(initialPage: 0, keepPage: true); + RRTViewModel viewModel; + bool loadingData; + @override void initState() { super.initState(); tabController = TabController(length: 2, vsync: this); } + TranslationBase localize; @override Widget build(BuildContext context) { + localize = TranslationBase.of(context); return AppScaffold( - appBarTitle: 'Rapid Response Team', + appBarTitle: localize.rapidResponseTeam, isShowAppBar: true, - body: Column( + body: BaseView( + onModelReady: (vm) async { + viewModel = vm; + loadingData = true; + await vm.loadRequiredData().then((value){ + }).whenComplete(() => setState(() => loadingData = false)); + }, + builder: (ctx, vm, widget) => content(), + ) + ); + } + + Widget content(){ + if(loadingData == true){ + return Center(child: CircularProgressIndicator()); + // else if(viewModel.state == ViewState.Error) + + }else if(viewModel.rrtServiceData != null && viewModel.rrtServiceData.servicePrice != null){ + return Column( children: [ tabBar(), Expanded( child: contentPager() ) ], - ), - ); + ); + }else{ + return Container( + alignment: Alignment.center, + child: Text(localize.somethingWentWrongTryLater, style: TextStyle(color: Colors.red), maxLines: 5,), + ); + } } Widget tabBar() => Container( @@ -52,10 +83,10 @@ class RRTMainScreenState extends State with SingleTickerProvider indicatorSize: TabBarIndicatorSize.label, tabs: [ Tab( - child: Text("Rapid Response Team", style: TextStyle(color: Theme.of(context).appBarTheme.color),), + child: Text(localize.rapidResponseTeam, style: TextStyle(color: Theme.of(context).appBarTheme.color),), ), Tab( - child: Text("Order Log", style: TextStyle(color: Theme.of(context).appBarTheme.color),), + child: Text(localize.orderLog, style: TextStyle(color: Theme.of(context).appBarTheme.color),), ), ] ), @@ -65,8 +96,8 @@ class RRTMainScreenState extends State with SingleTickerProvider onPageChanged: onPageChanged, controller: pageController, children: [ - RRTRequestPage(), - RRTLogPage(), + RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders), + RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), ], ); diff --git a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart new file mode 100644 index 00000000..ed6078ff --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart @@ -0,0 +1,71 @@ + +import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); + +class RRTLogListItem extends StatelessWidget{ + final PrescriptionsOrder order; + final Function(PrescriptionsOrder) onCancel; + RRTLogListItem(this.order, {this.onCancel}); + + BuildContext _context; + + TranslationBase localize; + @override + Widget build(BuildContext context) { + _context = context; + localize = TranslationBase.of(context); + + return Container( + padding: EdgeInsets.all(15), margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.25), spreadRadius: 1, blurRadius: 3)] + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + _contentItem(label: localize.reqId, value: order.iD.toString()), + _item_content_seperator, + _contentItem(label: localize.status, value: order.getStatusName(localize)), + _item_content_seperator, + _contentItem(label: localize.pickupDate, value: order.getFormattedDateTime()), + _item_content_seperator, + _contentItem(label: localize.location, value: order.getNearestProjectDescription()), + _item_content_seperator, + SizedBox(height: 10), + + if(onCancel != null) + FractionallySizedBox(child: cancelButton()) + ], + ), + ); + } + + Widget _contentItem({@required String label, String value}){ + return Container( + padding: EdgeInsets.symmetric(vertical: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(label, style: TextStyle(color: Theme.of(_context).appBarTheme.color, fontSize: 9, letterSpacing: 1),), + SizedBox(height: 5,), + Text(value, style: TextStyle(color: Theme.of(_context).appBarTheme.color,fontWeight: FontWeight.bold, fontSize: 14),), + ], + ), + ); + } + + Widget cancelButton() => MaterialButton( + height: 45, + color: Color(0xFFc5272d), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: () => onCancel(order), + child: Text(localize.cancel, style: TextStyle(color: Colors.white, fontSize: 13),), + + ); +} diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart index 5b6bf6f6..20acbbb4 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -1,18 +1,33 @@ import 'dart:async'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_material_pickers/flutter_material_pickers.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:provider/provider.dart'; + +import 'rrt-place-order.dart'; class RRTRequestPickupAddressPage extends StatefulWidget{ + final ServicePrice servicePrice; + RRTRequestPickupAddressPage({@required this.servicePrice}); + @override State createState() => RRTRequestPickupAddressPageState(); @@ -28,55 +43,95 @@ class RRTRequestPickupAddressPageState extends State myAdresses = ["One","Two","Three",]; - dynamic selectedAddress; - + List myAddresses = []; + Addresses selectedAddress; + StreamController addressStreamController = StreamController(); + Stream addressStream; + StreamController addressLoadingStreamController = StreamController(); + Stream addressLoadingStream; + @override void initState(){ super.initState(); goToCurrentLocation(); + addressStream = addressStreamController.stream; + addressLoadingStream = addressLoadingStreamController.stream; + } + + void loadAddresses() async{ + // GifLoaderDialogUtils.showMyDialog(context); + myAddresses = await viewModel.getAddresses(); + // GifLoaderDialogUtils.hideDialog(context); + + if(myAddresses.isNotEmpty) + setState(() {}); } + TranslationBase localize; + RRTViewModel viewModel; + @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (viewModel){ + localize = TranslationBase.of(context); + ProjectViewModel projectViewModel = Provider.of(context); + + addressStreamController.sink.add(0); + return BaseView( + onModelReady: (vm){ + viewModel = vm; + loadAddresses(); }, builder: (ctx, vm, widget) => AppScaffold( - appBarTitle: TranslationBase.of(context).pickupLocation, + appBarTitle: localize.pickupLocation, isShowAppBar: true, body: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - selectAddress(), + StreamBuilder( + stream: addressStream, + builder: (context, snapshot) { + return selectAddressField(); + } + ), + StreamBuilder( + stream: addressLoadingStream, + builder: (context, snapshot) { + return snapshot.hasData ? LinearProgressIndicator(backgroundColor: Colors.transparent) : Container(height: 4,); + } + ), Expanded( - child: Stack( - children: [ - GoogleMap( - myLocationEnabled: true, - onTap: moveToLocation, - mapType: MapType.normal, - initialCameraPosition: mapCameraPosition, - onCameraIdle: (){ - mapIdle = true; - setState((){}); - }, - onCameraMove: (camPosition){ - mapCameraPosition = camPosition; - }, - onCameraMoveStarted: (){ - mapIdle = false; - setState((){}); - }, - onMapCreated: (controller){ - mapController.complete(controller); - }, - ), - - centerTargetPoint() - ], - ) + child: + PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + searchForInitialValue: false, + selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { + if(state == SearchingState.Idle){ + addressLoadingStreamController.sink.add(null); + if(selectedPlace != null){ + var loc = selectedPlace.geometry.location; + var address1 = selectedPlace.addressComponents.first.longName; + var address2 = ""; + if(selectedPlace.addressComponents.length > 1) + address2 = selectedPlace.addressComponents[1].longName; + + selectedAddress = Addresses(latLong: '${loc.lat},${loc.lng}', address1: address1, address2: address2); + addressStreamController.sink.add(0); + } + }else{ + addressLoadingStreamController.sink.add(0); + } + return Container(); + }, + initialPosition: LatLng(24.7114693, 46.67469582), + useCurrentLocation: false, + ), ), continueButton() ], @@ -104,23 +159,20 @@ class RRTRequestPickupAddressPageState extends State + Navigator.push( + context, + FadePage(page: RRTPlaceOrderPage(selectedAddress: selectedAddress, servicePrice: widget.servicePrice,)) + ), + child: Text(localize.continues, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),), ), ); } @@ -144,19 +200,26 @@ class RRTRequestPickupAddressPageState extends State 1){ + var cordinates = itm.latLong.split(','); + var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last)); + moveToLocation(latlng); + }else{ + AppToast.showErrorToast(message: 'Invalid address coordinates'); + } }); }, ); diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart new file mode 100644 index 00000000..9cded48d --- /dev/null +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -0,0 +1,191 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +class RRTPlaceOrderPage extends StatelessWidget{ + TranslationBase localize; + RRTViewModel viewModel; + Addresses selectedAddress; + final ServicePrice servicePrice; + + RRTPlaceOrderPage({@required this.selectedAddress, @required this.servicePrice}); + + TextEditingController noteController = TextEditingController(text: ''); + BuildContext _context; + @override + Widget build(BuildContext context) { + _context = context; + localize = TranslationBase.of(context); + var lat = selectedAddress.latLong.split(',').first; + var lng = selectedAddress.latLong.split(',').last; + + return BaseView( + onModelReady: (vm) => viewModel = vm, + builder: (ctx,vm,wState){ + return AppScaffold( + appBarTitle: localize.rapidResponseTeam, + isShowAppBar: true, + body: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + child: SingleChildScrollView( + padding: EdgeInsets.all(20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text(localize.selectedLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), + + selectedAddressField(), + + AspectRatio( + aspectRatio: 3/1, + child: ClipRRect( + clipBehavior: Clip.hardEdge, + borderRadius: BorderRadius.circular(10), + child: Image.network( + "https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=16&size=800x400&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", + fit: BoxFit.cover, + ), + ), + ), + + SizedBox(height: 10,), + + Container( + height: 70, + margin: EdgeInsets.symmetric(vertical: 5), + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(10), + boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2,2), color: Colors.grey.withOpacity(0.25))] + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(localize.totalAmountPayable, style: TextStyle(fontSize: 13),), + SizedBox(height: 5,), + Text("${servicePrice.totalPrice ?? '- - -'} ${localize.sar}" , style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),), + ], + ), + ), + + Container( + height: 70, + margin: EdgeInsets.symmetric(vertical: 5), + padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(10), + boxShadow: [BoxShadow(blurRadius: 5, spreadRadius: 2, offset: Offset(2,2), color: Colors.grey.withOpacity(0.25))] + ), + child: TextField( + controller: noteController, + style: TextStyle(fontSize: 18.0), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + labelText: localize.notes, + contentPadding: const EdgeInsets.only(left: 14.0, bottom: 8.0, top: 8.0), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.white), + borderRadius: BorderRadius.circular(10), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Colors.white), + borderRadius: BorderRadius.circular(10), + ), + ) + ), + ), + ], + ), + ), + ), + submitButton(context) + ], + ) + ); + }, + ); + } + + + Widget selectedAddressField(){ + var address = "${selectedAddress.address1 ?? ''} ${selectedAddress.address2 ?? ''}"; + return Container( + margin: EdgeInsets.symmetric(vertical: 10), + child: Expanded( + child: MaterialButton( + height: 50, color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + onPressed: (){}, + child: Row( + children: [ + Expanded(child: Text(address, style: TextStyle(color: Colors.black87, fontSize: 15, letterSpacing: 1))), + Icon(Icons.location_on_rounded, size: 30, color: Colors.black,) + ], + ), + ), + ), + ); + } + + + Widget submitButton(BuildContext context){ + return Padding( + padding: const EdgeInsets.all(15), + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + onPressed: () => placeOrder(), + child: Text(localize.submit, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),), + ), + ); + } + + placeOrder() async{ + if(selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong.isNotEmpty && selectedAddress.latLong.split(',').length > 1){ + GifLoaderDialogUtils.showMyDialog(_context); + + Map params = {}; + var cordinates = selectedAddress.latLong.split(','); + var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last)); + params['Latitude'] = latlng.latitude; + params['Longitude'] = latlng.longitude; + params['Notes'] = noteController.text; + var requestId = await viewModel.createOrder(params); + + GifLoaderDialogUtils.hideDialog(_context); + + if(requestId != null){ + AlertDialogBox( + context: _context, + title: '', + message: localize.rrtOrderSuccessMessage, + okText: localize.ok, + okFunction: (){ + + } + ).showAlertDialog(); + } + }else{ + AppToast.showErrorToast(message: 'Invalid location selected'); + } + + } + + gotoRRTRoot(){ + + } +} \ No newline at end of file diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index 14a244d5..4cbfeb4b 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -1,6 +1,13 @@ +import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-agreement-page.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -8,47 +15,79 @@ import 'package:flutter/material.dart'; class RRTRequestPage extends StatefulWidget{ + final List pendingOrders; + final ServicePrice servicePrice; + + RRTRequestPage({this.pendingOrders, this.servicePrice}); + @override - State createState() => RRTRequestPageState(); + State createState() => RRTRequestPageState(); } class RRTRequestPageState extends State{ bool acceptTerms = false; + TranslationBase localize; + RRTViewModel viewModel; + @override Widget build(BuildContext context) { + localize = TranslationBase.of(context); return BaseView( - onModelReady: (viewModel) async{ - await viewModel.getRequiredData(); - }, - builder: (ctx, vm, widget) => Column( - children: [ - Expanded( - child: ListView( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), - children: [ - serviceDescription(context), - SizedBox(height: 20), - priceTable(context), - - acceptPolicy(), - - Container(height: 0.5, color: Theme.of(context).appBarTheme.color),// Seperator - - Container( - padding: EdgeInsets.only(top: 20, bottom: 5), - alignment: Alignment.center, - child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2) - ), - - paymentOptions(), - ], + onModelReady: (vm){ + viewModel = vm; + }, + builder: (ctx, vm, widgetState){ + + if(widget.pendingOrders.isNotEmpty) + return currentOrderContent(); + else + return requestContent(); + + }, + ); + + } + + Widget requestContent(){ + return Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + children: [ + serviceDescription(context), + SizedBox(height: 20), + priceTable(context), + + acceptPolicy(), + + Container(height: 0.5, color: Theme.of(context).appBarTheme.color),// Seperator + + Container( + padding: EdgeInsets.only(top: 20, bottom: 5), + alignment: Alignment.center, + child: Text(localize.youCanPayByTheFollowingOptions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2) ), - ), - actionButtons() - ], - ) + paymentOptions(), + ], + ), + ), + + actionButtons() + ], + ); + } + + Widget currentOrderContent(){ + var orders = widget.pendingOrders; + return ListView.builder( + itemCount: orders.length, + itemBuilder: (ctx, idx) { + var order = orders[idx]; + return RRTLogListItem(order, onCancel: deleteOrder); + } ); } @@ -56,7 +95,7 @@ class RRTRequestPageState extends State{ Padding( padding: const EdgeInsets.symmetric(horizontal: 10), child: Text( - TranslationBase.of(context).rrtDDetails, + localize.rrtDDetails, textAlign: TextAlign.justify, style: TextStyle(color: Theme.of(context).appBarTheme.color, fontSize: 15, height: 1.5, fontWeight: FontWeight.w300), ), @@ -64,22 +103,25 @@ class RRTRequestPageState extends State{ Widget priceTable(BuildContext context){ var radius = Radius.circular(8); + String amount = widget.servicePrice.price.toString(); + String vat = widget.servicePrice.vat.toString(); + String total = widget.servicePrice.totalPrice.toString(); return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Container( height: 30, decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.only(topLeft: radius, topRight: radius)), - child: Center(child: Text(TranslationBase.of(context).approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), + child: Center(child: Text(localize.approximateServiceFee, style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500, letterSpacing: 1))), ), - pricingRow(label: TranslationBase.of(context).amountBeforeTax, value: '500 SAR'), + pricingRow(label: localize.amountBeforeTax, value: '$amount ${localize.sar}'), Container(height: 0.5, color: Theme.of(context).appBarTheme.color), - pricingRow(label: TranslationBase.of(context).taxAmount, value: '50 SAR'), + pricingRow(label: localize.taxAmount, value: '$vat ${localize.sar}'), Container(height: 0.5, color: Theme.of(context).appBarTheme.color), - pricingRow(label: TranslationBase.of(context).totalAmountPayable, value: '550 SAR', labelBold: true), + pricingRow(label: localize.totalAmountPayable, value: '$total ${localize.sar}', labelBold: true), Container(height: 0.5, color: Theme.of(context).appBarTheme.color), ], ); @@ -115,15 +157,18 @@ class RRTRequestPageState extends State{ }), SizedBox(width: 10), Expanded( - child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2) + child: Text(localize.iAcceptTermsConditions, style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color), maxLines: 2) ), Container( alignment: Alignment.center, width: MediaQuery.of(context).size.width * 0.25, child: TextButton( - child: Text(TranslationBase.of(context).clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)), + child: Text(localize.clickHere, style: TextStyle(fontSize: 12, color: Colors.blue, fontWeight: FontWeight.w400)), onPressed: (){ - + Navigator.push( + context, + FadePage( + page: RRTAgreementPage())); } ), ) @@ -133,10 +178,10 @@ class RRTRequestPageState extends State{ } Widget paymentOptions()=> Container( - height: 30, - alignment: Alignment.center, - child: Image.asset("assets/payment_options/payment_options.png", fit: BoxFit.fill,) - ); + height: 30, + alignment: Alignment.center, + child: Image.asset("assets/payment_options/payment_options.png", fit: BoxFit.fill,) + ); Widget actionButtons(){ return Container( @@ -149,28 +194,46 @@ class RRTRequestPageState extends State{ color: Theme.of(context).appBarTheme.color, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), onPressed: () { }, - child: Text(TranslationBase.of(context).cancel, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + child: Text(localize.cancel, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), ), ), SizedBox(width: 20,), Expanded( child: MaterialButton( - height: 50, - color: Theme.of(context).appBarTheme.color, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), - child: Text(TranslationBase.of(context).ok, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), - onPressed: () { - Navigator.push( - context, - FadePage( - page: RRTRequestPickupAddressPage())); - }, + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + child: Text(localize.ok, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + onPressed: () { + if(acceptTerms) + goToPickupAddress(); + else + AppToast.showErrorToast(message: localize.pleaseAcceptTerms); + } ), ) ], ), ); } + + goToPickupAddress()async{ + Navigator.push( + context, + FadePage(page: RRTRequestPickupAddressPage(servicePrice: widget.servicePrice,)) + ); + } + + + deleteOrder(PrescriptionsOrder order) async { + GifLoaderDialogUtils.showMyDialog(context); + var success = await viewModel.cancelOrder(order); + GifLoaderDialogUtils.hideDialog(context); + if(success) + setState(() { + widget.pendingOrders.remove(order); + }); + } } \ No newline at end of file diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index 0bc93081..30720401 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -144,7 +144,7 @@ class _ForgotPassword extends State { Navigator.of(context).pop(); AlertDialogBox( context: con, - confirmMessage: res['ReturnMessage'], + message: res['ReturnMessage'], okText: TranslationBase.of(con).ok, okFunction: () { AlertDialogBox.closeAlertDialog(con); diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 1591d1d5..faac5fc8 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -256,7 +256,7 @@ class _Register extends State { // AppToast.showErrorToast(message: response['ErrorEndUserMessage']); AlertDialogBox( context: context, - confirmMessage: response['ErrorEndUserMessage'], + message: response['ErrorEndUserMessage'], okText: TranslationBase.of(context).ok, okFunction: () { AlertDialogBox.closeAlertDialog(context); @@ -276,7 +276,7 @@ class _Register extends State { //AppToast.showErrorToast(message: response); AlertDialogBox( context: context, - confirmMessage: response, + message: response, okText: TranslationBase.of(context).ok, okFunction: () { AlertDialogBox.closeAlertDialog(context); diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index 592359ca..7856a506 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; @@ -10,12 +12,14 @@ class PharmacyAddressService extends BaseService { CountryData country; int selectedAddressIndex = 0; - Future getAddresses() async { + Future> getAddresses() async { var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); Map queryParams = {'fields': 'addresses'}; hasError = false; Addresses selectedAddress; try { + var completer = Completer(); + await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId", onSuccess: (dynamic response, int statusCode) async { addresses.clear(); @@ -33,13 +37,19 @@ class PharmacyAddressService extends BaseService { addresses.add(address); index++; }); + completer.complete(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, queryParams: queryParams); - } catch (error) { + + await completer.future; + + } catch (error){ throw error; } + + return addresses; } Future getCountries(String countryName) async { diff --git a/lib/uitl/HMGNetworkConnectivity.dart b/lib/uitl/HMGNetworkConnectivity.dart index c4044573..213f9b46 100644 --- a/lib/uitl/HMGNetworkConnectivity.dart +++ b/lib/uitl/HMGNetworkConnectivity.dart @@ -76,7 +76,7 @@ class HMGNetworkConnectivity { AlertDialogBox( context: context, okText: translator.ok, - confirmMessage: message, + message: message, okFunction: () { AlertDialogBox.closeAlertDialog(context); }).showAlertDialog(context); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 9127f582..b37932f2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1166,8 +1166,14 @@ class TranslationBase { String get taxAmount => localizedValues['TaxAmount'][locale.languageCode]; String get totalAmountPayable => localizedValues['TotalAmountPayable'][locale.languageCode]; String get iAcceptTermsConditions => localizedValues['iAcceptTermsConditions'][locale.languageCode]; + String get somethingWentWrongTryLater => localizedValues['somethingWentWrongTryLater'][locale.languageCode]; String get youCanPayByTheFollowingOptions => localizedValues['YouCanPayByTheFollowingOptions'][locale.languageCode]; String get rrtService => localizedValues['rrtService'][locale.languageCode]; + String get rrtUserAgreementTitle => localizedValues['rrtUserAgreementTitle'][locale.languageCode]; + String get rrtUserAgreementP1 => localizedValues['rrtUserAgreementP1'][locale.languageCode]; + String get rrtUserAgreementP2 => localizedValues['rrtUserAgreementP2'][locale.languageCode]; + String get rrtUserAgreementP3 => localizedValues['rrtUserAgreementP3'][locale.languageCode]; + String get rrtOrderSuccessMessage => localizedValues['rrtOrderSuccessMessage'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode]; String get transportMethod => localizedValues['transport-method'][locale.languageCode]; diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index d73bf6e8..9759ef5c 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -501,7 +501,7 @@ class Utils { } else { AlertDialogBox( context: context, - confirmMessage: + message: "Please login with your account first to use this feature", okText: "OK", okFunction: () { diff --git a/lib/widgets/dialogs/alert_dialog.dart b/lib/widgets/dialogs/alert_dialog.dart index 81507326..be202fd9 100644 --- a/lib/widgets/dialogs/alert_dialog.dart +++ b/lib/widgets/dialogs/alert_dialog.dart @@ -5,24 +5,29 @@ import 'package:flutter/material.dart'; class AlertDialogBox { final BuildContext context; - final confirmMessage; + final title; + final message; final okText; final Function okFunction; AlertDialogBox( {@required this.context, - @required this.confirmMessage, + this.title, + @required this.message, @required this.okText, @required this.okFunction}); - showAlertDialog(BuildContext context) { + showAlertDialog({BuildContext context}) { Widget continueButton = - FlatButton(child: Text(this.okText), onPressed: this.okFunction); + FlatButton(child: Text(this.okText), onPressed: (){ + this.okFunction(); + closeAlertDialog(context); + }); // set up the AlertDialog AlertDialog alert = AlertDialog( - title: Text(TranslationBase.of(context).confirm), - content: Text(this.confirmMessage), + title: Text(title ?? TranslationBase.of(context).confirm), + content: Text(this.message), actions: [ continueButton, ], @@ -31,7 +36,7 @@ class AlertDialogBox { // show the dialog showDialog( barrierDismissible: false, - context: context, + context: this.context, builder: (BuildContext context) { return alert; }, From 10a147860c59a0a58b6be40e88560100f34eff7b Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Tue, 10 Aug 2021 18:10:18 +0300 Subject: [PATCH 33/39] no message --- .../ErService/rapid-response-team/rrt-place-order.dart | 10 +++++++--- lib/widgets/dialogs/alert_dialog.dart | 3 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index 9cded48d..c2d943ed 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; +import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -175,9 +176,10 @@ class RRTPlaceOrderPage extends StatelessWidget{ message: localize.rrtOrderSuccessMessage, okText: localize.ok, okFunction: (){ - + AlertDialogBox.closeAlertDialog(_context); + gotoRRTRoot(); } - ).showAlertDialog(); + ).showAlertDialog(_context); } }else{ AppToast.showErrorToast(message: 'Invalid location selected'); @@ -186,6 +188,8 @@ class RRTPlaceOrderPage extends StatelessWidget{ } gotoRRTRoot(){ - + Navigator.pushAndRemoveUntil( + _context, + MaterialPageRoute(builder: (context) => ErOptions(isAppbar: true)), (Route r) => false); } } \ No newline at end of file diff --git a/lib/widgets/dialogs/alert_dialog.dart b/lib/widgets/dialogs/alert_dialog.dart index be202fd9..5e0bbb35 100644 --- a/lib/widgets/dialogs/alert_dialog.dart +++ b/lib/widgets/dialogs/alert_dialog.dart @@ -17,11 +17,10 @@ class AlertDialogBox { @required this.okText, @required this.okFunction}); - showAlertDialog({BuildContext context}) { + showAlertDialog(BuildContext context) { Widget continueButton = FlatButton(child: Text(this.okText), onPressed: (){ this.okFunction(); - closeAlertDialog(context); }); // set up the AlertDialog From bd85854fa4eadc7959489be7ce838524df77b5c8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 11 Aug 2021 09:38:39 +0300 Subject: [PATCH 34/39] changes --- lib/config/config.dart | 2 +- .../Authentication/register_user_requet.dart | 15 +++++++++------ lib/pages/login/login.dart | 5 ----- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f4c5e559..0c18ecbb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -262,7 +262,7 @@ const IS_DENTAL_ALLOWED_BACKEND = false; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; var DEVICE_TOKEN = ""; -var IS_VOICE_COMMAND_CLOSED = false; +var IS_VOICE_COMMAND_CLOSED = true; var IS_TEXT_COMPLETED = false; var DeviceTypeID = Platform.isIOS ? 1 : 2; const LANGUAGE_ID = 2; diff --git a/lib/models/Authentication/register_user_requet.dart b/lib/models/Authentication/register_user_requet.dart index 7758ce5b..12e59d0a 100644 --- a/lib/models/Authentication/register_user_requet.dart +++ b/lib/models/Authentication/register_user_requet.dart @@ -83,6 +83,7 @@ class Patientobject { String dateofBirth; int gender; String nationalityID; + String eHealthIDField; String dateofBirthN; String emailAddress; String sourceType; @@ -96,15 +97,16 @@ class Patientobject { this.mobileNumber, this.patientOutSA, this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, this.strDateofBirth, this.dateofBirth, this.gender, this.nationalityID, + this.eHealthIDField, this.dateofBirthN, this.emailAddress, this.sourceType, @@ -127,6 +129,7 @@ class Patientobject { dateofBirth = json['DateofBirth']; gender = json['Gender']; nationalityID = json['NationalityID']; + eHealthIDField = json['eHealthIDField']; dateofBirthN = json['DateofBirthN']; emailAddress = json['EmailAddress']; sourceType = json['SourceType']; @@ -152,10 +155,10 @@ class Patientobject { data['DateofBirth'] = this.dateofBirth; data['Gender'] = this.gender; data['NationalityID'] = this.nationalityID; + data['eHealthIDField'] = this.eHealthIDField; data['DateofBirthN'] = this.dateofBirthN; data['EmailAddress'] = this.emailAddress; data['SourceType'] = this.sourceType; - data['PreferredLanguage'] = this.preferredLanguage; data['Marital'] = this.marital; return data; diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c5da90d5..1c0fd13e 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -64,11 +64,6 @@ class _Login extends State { void initState() { // getDeviceToken(); super.initState(); - - if(BASE_URL.contains("uat.")){ - nationalIDorFile.text = "1231755"; - mobileNumberController.text = mobileNo = "537503378"; - } } getDeviceToken() async { From b1453b52e3c04af9cbeac9dedfefbba45eae62bf Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 11 Aug 2021 16:31:47 +0300 Subject: [PATCH 35/39] registration --- lib/pages/login/register-info.dart | 32 ++++++++++++++++--- .../authentication/auth_provider.dart | 1 + 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index d28fea86..e1152032 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -2,8 +2,9 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; -import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; -import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' + as checkActivation; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -20,6 +21,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:provider/provider.dart'; class RegisterInfo extends StatefulWidget { @override @@ -45,6 +50,13 @@ class _RegisterInfo extends State { String email = ''; String location = '1'; + AuthenticatedUserObject authenticatedUserObject = + locator(); + + ProjectViewModel projectViewModel; + + AppointmentRateViewModel appointmentRateViewModel = + locator(); @override void initState() { @@ -56,6 +68,8 @@ class _RegisterInfo extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, @@ -300,16 +314,17 @@ class _RegisterInfo extends State { } else { + 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), - Navigator.of(context).pushNamed(HOME) + this.setUser(result), } }) .catchError((err) { - GifLoaderDialogUtils.hideDialog(context); + // GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: err, @@ -321,6 +336,15 @@ class _RegisterInfo extends State { }); } + setUser(result) async { + await authenticatedUserObject.getUser(getUser: true); + authenticatedUserObject.isLogin = true; + appointmentRateViewModel.isLogin = true; + projectViewModel.isLogin = true; + authenticatedUserObject.user = result.list; + Navigator.of(context).pushNamed(HOME); + } + getRegisterInfo() async { var data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 926ee2bc..dcc5599b 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -328,6 +328,7 @@ class AuthProvider with ChangeNotifier { request['LanguageID'] = LANGUAGE_ID; var requestN = RegisterUserRequest.fromJson(request); requestN.patientOutSA = requestN.patientobject.patientOutSA; + await sharedPref.remove(USER_PROFILE); // request.tokenID = ''; dynamic localRes; try { From a32501f3dc36eb9cd3a725b1ca3cf6f9979a2687 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 11 Aug 2021 17:29:52 +0300 Subject: [PATCH 36/39] My invoices implementation continued --- assets/images/medical/Invoice.png | Bin 0 -> 1748 bytes assets/images/new-design/ViewDetailsIco.png | Bin 0 -> 1314 bytes lib/config/config.dart | 5 +- lib/config/localized_values.dart | 8 + .../GetDentalAppointmentsResponse.dart | 100 ++++++++ lib/pages/BookAppointment/BookConfirm.dart | 2 +- .../BookAppointment/widgets/DoctorView.dart | 8 +- .../widgets/AppointmentActions.dart | 4 +- .../my_invoices/invoice_detail_page.dart | 51 ++++ .../medical/my_invoices/my_invoice_page.dart | 234 ++++++++++++++++++ .../my_invoice_services.dart | 53 ++++ lib/uitl/translations_delegate_base.dart | 6 + lib/uitl/utils.dart | 12 + 13 files changed, 476 insertions(+), 7 deletions(-) create mode 100644 assets/images/medical/Invoice.png create mode 100644 assets/images/new-design/ViewDetailsIco.png create mode 100644 lib/models/MyInvoices/GetDentalAppointmentsResponse.dart create mode 100644 lib/pages/medical/my_invoices/invoice_detail_page.dart create mode 100644 lib/pages/medical/my_invoices/my_invoice_page.dart create mode 100644 lib/services/my_invoice_service/my_invoice_services.dart diff --git a/assets/images/medical/Invoice.png b/assets/images/medical/Invoice.png new file mode 100644 index 0000000000000000000000000000000000000000..1e3b6f250398cd114afa63e6b05e842ca4eaacd6 GIT binary patch literal 1748 zcmb_d={wsC8Vwb$+(c_@VvB0H#au*eV;RAZkXuC)%fzHn)o??jxUrPd+9K5|9aOcA zB~i82Ry9?rmb9@{Bd#cJsaje~ZIhc)`{;a{KVUw*=RD_mpL3q`>3y&Hc)7zMnh+2O z1jBo{5)SzM_xVBo0HdZ0eGf?HH-fths9vbO00PP1#Jf8CCde$agIKqvRBLux)N&!~Q_7_Ad$V4%@X7XFWb* zVJQ(Nq&b6|Uv@-M6)AF&OQd7JhY#K17f=b^&J^^k)cMMv()E6d z)t&_d+N{WM4C37XcTuwJ4Q)5C;QKbK)}_2hxw*qnhf=a*inG5(vK+6}zsxPhjj_`Q zD(_B2#l+V{P_C~M-ytT}JE7GZ>X&Qa*8F(DAN@`B0z`zHcu0r~*7{^`ytrKuYs5{2 zQ)G5kM*Z%)@NJw+mz53z1y}GHbQ50HX@rc2jP5>?1*kFZK)R9f^({ii@7qWs?V3$n-<>+`4uJaVeGkVIn;D(c5@HJQLd;*UmHQ z@Fsooa|}M;nI{)aHc$Y_Mx~-iw7xSUptti#K;MZLEhzqoz%K^CE4T`5wg|*my=+eYHZ-;5Ot6F9ZI&03gz!f4AUg8#^+rUQ{? zsr#?IFx5?>N#E@4GwW8at2;7?3}dM?R(u>c>XmA9Iu4N1X0{u_f_qi%>lqE*N(L(Uu85QZ}WXylJl20 z8`Y#X8T(forjGUWTYS_WRSmFT`s41Ojk>&R9F1n#PtsEY_(vKdQy|iKp~QFNYFINP9igYD3B->?kP#5)=WfQ^N%t282Xa^eh@7cT`ob{rm3%EMwq_HSF! zxQu~jOgKXt#a1usJaNi+yRhX^qZ)%-oFtttFt~MM%H=6S%GyI;J~WvoR0$ibWs1Qg z+&d+ZAx%PQLlRBvT^{H8ZfrHY3w3bxk;Ucpa)5)yY)}rJdmL#)`2N2@csDQCdY7|l F{{bntGY9|x literal 0 HcmV?d00001 diff --git a/assets/images/new-design/ViewDetailsIco.png b/assets/images/new-design/ViewDetailsIco.png new file mode 100644 index 0000000000000000000000000000000000000000..cd58bddb8718ec93d9343daf41a7e8500639b297 GIT binary patch literal 1314 zcmV+-1>O3IP)mg5$ZTqG7` z2jKi7>&{q?yAtPQWk`PC=*f=6xnV*rGVDE-%k-%nY@0?Nz;a4};P-utA9Q3zvLts; zat0Iarcls%%W?Bj4iAN7z?G0;AT3?99GAR$OSSB-T@FZk$2N^n&)XET2LPoA^irz> zT3NEt1AtPW*rt(f_G2KVZ5lZZkxQpluuWq$5~OV!Cjcz;7$7((34A{rysK>*E2=}q zSndKw&c2nfjrH39YX|FdAE3HfRy}pr9|qPza*%yh<%%O`r!khBQ*B5jJ=ojB>eMTE zuvb+%?LL6f+NdbwJD{bP3eu5@m&9Ibko(z1)dmG>;MkaWaGCyoJpR-e?*6)_a{3_0 z)E=hb6B;@6kOtXk|3k9t?WVX?hdfBxU7HT1 zsv4d=gF{D$mCo9~vyJT=i@G5v$at3HZfS=cn#|(K@#mDzxx4;LJ0QV1rhtj{QLzBy;`4$pf0>V z_r8`{O&_l)rKa)AUp4@e=)Hd7%2n|YdK!|tqjXY#e)ly>uUS|+{UXZw%VOWav8OTm z=5*5A+)EYm$jO(*=gyCdxc%)F?BCfD-LrE2d+e5$#cxkM`+TB%(DGlZkePvpU6J7Y z+AS@KJ*vZzPqg%hzPQU_I`j{FPV%gN(Rd4XKnWxkapgF6PW<_Evri!UUl4vZfT>qhNA7%bz#6uZ7 z8cJe-F3Pl|fTR=wui|!G|9M35k$#=0@0wN5O&EL(Sp@4{zt*Zg;ws$lVAXKX) zx%4IN%8&{>naBmdN_kf<*c(r=`+h-dH>wrQu`8E(xjNsWpn)d!mpWF|TPv==o8jQ0 z9W}6t;G}dG+Gjc9$R@PzEv~F8a`cs0?fT0Et$C71rca86X$!Kn%q@|n=snxe1?CCB YfA3QFMu-0^N&o-=07*qoM6N<$g0RShVgLXD literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index f8bca863..acdc5c40 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,7 +13,7 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs @@ -605,6 +605,9 @@ const FILTERED_PRODUCTS = 'products?categoryids='; const GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; +const GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = + "Services/Patients.svc/REST/GetDentalAppointments"; + class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1feb206a..cdcbb2fb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2101,4 +2101,12 @@ const Map localizedValues = { "ar": "تتيح لك هذه الخدمة إجراء استشارة عبر مكالمة فيديو مباشرة مع الطبيب من أي مكان وفي أي وقت" }, + "my-invoice": { + "en": "My Invoice", + "ar": "فواتيري" + }, + "invoice-list": { + "en": "Invoices List", + "ar": "فائمة الفواتير" + }, }; diff --git a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart new file mode 100644 index 00000000..a5a43cef --- /dev/null +++ b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart @@ -0,0 +1,100 @@ +class GetDentalAppointmentsResponse { + List listDentalAppointments; + + GetDentalAppointmentsResponse({this.listDentalAppointments}); + + GetDentalAppointmentsResponse.fromJson(Map json) { + if (json['List_DentalAppointments'] != null) { + listDentalAppointments = new List(); + json['List_DentalAppointments'].forEach((v) { + listDentalAppointments.add(new ListDentalAppointments.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listDentalAppointments != null) { + data['List_DentalAppointments'] = + this.listDentalAppointments.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListDentalAppointments { + String setupId; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + dynamic appointmentDateN; + int clinicID; + int doctorID; + int invoiceNo; + int status; + String arrivedOn; + String doctorName; + dynamic doctorNameN; + String clinicName; + String doctorImageURL; + String projectName; + + ListDentalAppointments( + {this.setupId, + this.projectID, + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.clinicID, + this.doctorID, + this.invoiceNo, + this.status, + this.arrivedOn, + this.doctorName, + this.doctorNameN, + this.clinicName, + this.doctorImageURL, + this.projectName}); + + ListDentalAppointments.fromJson(Map json) { + setupId = json['SetupId']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + invoiceNo = json['InvoiceNo']; + status = json['Status']; + arrivedOn = json['ArrivedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupId'] = this.setupId; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['InvoiceNo'] = this.invoiceNo; + data['Status'] = this.status; + data['ArrivedOn'] = this.arrivedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['ProjectName'] = this.projectName; + return data; + } +} diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 966dc4d4..fe9113cb 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -544,7 +544,7 @@ class _BookConfirmState extends State { navigateToBookSuccess(context, docObject, widget.patientShareResponse); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + // AppToast.showErrorToast(message: err); navigateToHome(context); print(err); }); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index bb6fccab..7cdf7ed0 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -13,13 +13,15 @@ import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { final DoctorList doctor; bool isLiveCareAppointment; + bool isShowFlag; - DoctorView({@required this.doctor, @required this.isLiveCareAppointment}); + DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true}); @override Widget build(BuildContext context) { return InkWell( onTap: () { + if(isShowFlag) getDoctorsProfile(context, doctor); }, child: Card( @@ -113,10 +115,10 @@ class DoctorView extends StatelessWidget { filledIcon: Icons.star, emptyIcon: Icons.star, ), - Container( + isShowFlag ? Container( child: Image.network(this.doctor.nationalityFlagURL, width: 25.0, height: 25.0), - ), + ) : Container(), ], ), ], diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 4658f83b..c37cf6ee 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -112,7 +112,7 @@ class _AppointmentActionsState extends State { e.title, color: Color(0xffB8382C), variant: "overline", - fontSize: SizeConfig.textMultiplier * 2.1, + fontSize: SizeConfig.textMultiplier * 1.8, ), ), Container( @@ -122,7 +122,7 @@ class _AppointmentActionsState extends State { e.subtitle, color: Colors.black, variant: "overline", - fontSize: SizeConfig.textMultiplier * 1.9, + fontSize: SizeConfig.textMultiplier * 1.6, ), ), ], diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart new file mode 100644 index 00000000..33df8fc3 --- /dev/null +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -0,0 +1,51 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InvoiceDetail extends StatelessWidget { + final DoctorList doctor; + final ListDentalAppointments listDentalAppointments; + + InvoiceDetail(this.doctor, this.listDentalAppointments); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).myInvoice, + isShowAppBar: true, + isShowDecPage: false, + body: Container( + child: Column( + children: [ + DoctorView(doctor: doctor, isLiveCareAppointment: false, isShowFlag: false), + Container( + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + padding: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0, bottom: 10.0), + decoration: BoxDecoration( + color: Colors.grey[800], + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Description", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Quantity", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Price", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + Text("Total", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + ], + ), + ), + ], + ), + )); + } +} diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart new file mode 100644 index 00000000..898d374a --- /dev/null +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -0,0 +1,234 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart' + as DoctorListResponse; +import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_invoices/invoice_detail_page.dart'; +import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_services.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class MyInvoices extends StatefulWidget { + @override + _MyInvoicesState createState() => _MyInvoicesState(); +} + +class _MyInvoicesState extends State { + bool isDataLoaded = false; + GetDentalAppointmentsResponse getDentalAppointmentsResponse; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) { + getDentalAppointments(); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).myInvoice, + isShowAppBar: true, + isShowDecPage: false, + body: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: isDataLoaded + ? Column( + children: [ + ...List.generate( + getDentalAppointmentsResponse + .listDentalAppointments.length, + (index) => InkWell( + onTap: () { + openInvoiceDetailsPage(getDentalAppointmentsResponse + .listDentalAppointments[index]); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.all(Radius.circular(8.0)), + ), + margin: EdgeInsets.all(10.0), + width: MediaQuery.of(context).size.width, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: Container( + margin: EdgeInsets.fromLTRB( + 20.0, 10.0, 20.0, 10.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.asset( + "assets/images/new-design/ViewDetailsIco.png", + fit: BoxFit.fill, + height: 60.0, + width: 60.0), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Appointment No: ", + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Appointment Date: ", + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only( + top: 10.0, bottom: 10.0), + child: Text("Clinic: ", + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + letterSpacing: 0.5)), + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + getDentalAppointmentsResponse + .listDentalAppointments[index] + .appointmentNo + .toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + DateUtil.getMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + getDentalAppointmentsResponse + .listDentalAppointments[ + index] + .appointmentDate)), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only( + top: 10.0, bottom: 10.0), + child: Text( + getDentalAppointmentsResponse + .listDentalAppointments[index] + .clinicName, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 0.5)), + ), + ], + ), + projectViewModel.isArabic + ? Container( + margin: EdgeInsets.only(left: 15.0), + child: Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + fit: BoxFit.fill, + height: 20.0, + width: 12.0), + ) + : Container( + margin: EdgeInsets.only(right: 15.0), + child: Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", + fit: BoxFit.fill, + height: 20.0, + width: 12.0), + ), + ], + ), + ), + ), + ), + ], + ) + : Container(), + ), + )); + } + + openInvoiceDetailsPage(ListDentalAppointments listDentalAppointments) { + DoctorListResponse.DoctorList doctor = new DoctorListResponse.DoctorList(); + + doctor.name = listDentalAppointments.doctorName; + doctor.projectName = listDentalAppointments.projectName; + doctor.date = listDentalAppointments.appointmentDate; + doctor.actualDoctorRate = 0; + doctor.doctorImageURL = listDentalAppointments.doctorImageURL; + doctor.dayName = listDentalAppointments.invoiceNo; + doctor.doctorTitle = "Dr."; + doctor.clinicName = "InvoiceNo: " + listDentalAppointments.invoiceNo.toString(); + + Navigator.push( + context, + FadePage( + page: InvoiceDetail( + doctor, + listDentalAppointments, + ))); + } + + getDentalAppointments() { + GifLoaderDialogUtils.showMyDialog(context); + MyInvoicesService myInvoicesService = new MyInvoicesService(); + + myInvoicesService.getAllDentalAppointments(12, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + getDentalAppointmentsResponse = + GetDentalAppointmentsResponse.fromJson(res); + print(getDentalAppointmentsResponse.listDentalAppointments.length); + print(getDentalAppointmentsResponse + .listDentalAppointments[0].appointmentNo); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + isDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }); + } +} diff --git a/lib/services/my_invoice_service/my_invoice_services.dart b/lib/services/my_invoice_service/my_invoice_services.dart new file mode 100644 index 00000000..fc401c39 --- /dev/null +++ b/lib/services/my_invoice_service/my_invoice_services.dart @@ -0,0 +1,53 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + +class MyInvoicesService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getAllDentalAppointments(int projectID, + context) async { + Map request; + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "PatientID": authUser.patientID, + "License": true, + "IsRegistered": true, + "ProjectID": projectID, + "PatientTypeID":authUser.patientIdentificationType, + "PatientType":authUser.patientType, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value( + localRes + ); + } + +} \ No newline at end of file diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0a0e9b7c..bc88fea2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1673,6 +1673,12 @@ class TranslationBase { localizedValues["info-ereferral"][locale.languageCode]; String get erConsultation => localizedValues["er-consultation"][locale.languageCode]; + + String get myInvoice => + localizedValues["my-invoice"][locale.languageCode]; + + String get invoicesList => + localizedValues["invoice-list"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 06aeca9d..5c7eecde 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart' import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_invoices/my_invoice_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; @@ -302,6 +303,17 @@ class Utils { isEnable: projectViewModel.havePrivilege(6)), )); + medical.add(InkWell( + onTap: () => + projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).myInvoice, + imagePath: 'Invoice.png', + subTitle: TranslationBase.of(context).invoicesList, + isEnable: projectViewModel.havePrivilege(14), + ), + )); + medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, From 6b7eaaafb912362f03012fbb13ebfa11aeaab32c Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 12 Aug 2021 14:02:38 +0300 Subject: [PATCH 37/39] fixes --- lib/config/config.dart | 4 ++-- lib/pages/landing/landing_page.dart | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 1a309e96..b8782cf0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -17,8 +17,8 @@ const BASE_URL = 'https://uat.hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs -//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; -//const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // Pharmacy Production URLs const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index df0af1f3..ab9982d3 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -41,9 +41,11 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import '../../locator.dart'; import '../../routes.dart'; import 'home_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class LandingPage extends StatefulWidget { static LandingPage shared; @@ -70,6 +72,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { int currentTab = 0; PageController pageController; ProjectViewModel projectViewModel; + ToDoCountProviderModel model; var notificationCount = ''; var themeNotifier; @@ -101,10 +104,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { if (currentTab > 0 && tab == 2) pageController.jumpToPage(0); - else if (tab != 0) - pageController.jumpToPage(tab); - else { + else if (tab != 0) { + if (tab == 4 && model.count == 0) { + AppToast.showErrorToast( + message: TranslationBase.of(context).noBookedAppo); + } else { + pageController.jumpToPage(tab); + } + } else { IS_VOICE_COMMAND_CLOSED = false; + pageController.jumpToPage(tab); } currentTab = tab; @@ -471,7 +480,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - + model = Provider.of(context); return Scaffold( appBar: AppBar( elevation: 0, From f442cc251c6a41b2d73b2d0dd76ccbec3c6f56c7 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Thu, 12 Aug 2021 14:47:39 +0300 Subject: [PATCH 38/39] Pre Post Images Dental Doctor Profile --- lib/config/config.dart | 1 + lib/config/localized_values.dart | 1 + .../Appointments/DoctorListResponse.dart | 4 + lib/models/Appointments/DoctorProfile.dart | 4 + .../Appointments/doctor_pre_post_image.dart | 107 ++++++++++++++++ lib/pages/BookAppointment/DoctorProfile.dart | 50 +++++++- .../doctor_post_pre_images_page.dart | 121 ++++++++++++++++++ lib/pages/login/login.dart | 5 + .../appointment_services/GetDoctorsList.dart | 41 +++++- lib/uitl/translations_delegate_base.dart | 2 + 10 files changed, 329 insertions(+), 7 deletions(-) create mode 100644 lib/models/Appointments/doctor_pre_post_image.dart create mode 100644 lib/pages/BookAppointment/doctor_post_pre_images_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 3aa66dd1..20c9b063 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -49,6 +49,7 @@ const WIFI_CREDENTIALS = const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; +const GET_DOCTOR_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; const GET_DOCTOR_RATING_DETAILS = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e45af168..5cf126ef 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -59,6 +59,7 @@ const Map localizedValues = { 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, 'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'}, + 'beforeAfterImages': {'en': 'Before After Images', 'ar': 'قبل بعد الصور'}, 'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'}, 'clinic': {'en': 'Clinic', 'ar': 'العيادة'}, 'hospital': {'en': 'Hospital', 'ar': 'المستشفى'}, diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 4c7241c8..a038aaf4 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -21,6 +21,7 @@ class DoctorList { bool isDoctorAllowVedioCall; bool isDoctorDummy; bool isLiveCare; + bool isDoctorHasPrePostImages; String latitude; String longitude; String nationalityFlagURL; @@ -62,6 +63,7 @@ class DoctorList { this.isDoctorAllowVedioCall, this.isDoctorDummy, this.isLiveCare, + this.isDoctorHasPrePostImages, this.latitude, this.longitude, this.nationalityFlagURL, @@ -103,6 +105,7 @@ class DoctorList { isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isDoctorDummy = json['IsDoctorDummy']; isLiveCare = json['IsLiveCare']; + isDoctorHasPrePostImages = json['IsDoctorHasPrePostImages']; latitude = json['Latitude']; longitude = json['Longitude']; nationalityFlagURL = json['NationalityFlagURL']; @@ -147,6 +150,7 @@ class DoctorList { data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsLiveCare'] = this.isLiveCare; + data['IsDoctorHasPrePostImages'] = this.isDoctorHasPrePostImages; data['Latitude'] = this.latitude; data['Longitude'] = this.longitude; data['NationalityFlagURL'] = this.nationalityFlagURL; diff --git a/lib/models/Appointments/DoctorProfile.dart b/lib/models/Appointments/DoctorProfile.dart index bfc8c189..9b2bc8e9 100644 --- a/lib/models/Appointments/DoctorProfile.dart +++ b/lib/models/Appointments/DoctorProfile.dart @@ -24,6 +24,7 @@ class DoctorProfileList { Null isRegistered; Null isDoctorDummy; bool isActive; + bool isDoctorHasPrePostImages; Null isDoctorAppointmentDisplayed; bool doctorClinicActive; Null isbookingAllowed; @@ -67,6 +68,7 @@ class DoctorProfileList { this.isRegistered, this.isDoctorDummy, this.isActive, + this.isDoctorHasPrePostImages, this.isDoctorAppointmentDisplayed, this.doctorClinicActive, this.isbookingAllowed, @@ -110,6 +112,7 @@ class DoctorProfileList { isRegistered = json['IsRegistered']; isDoctorDummy = json['IsDoctorDummy']; isActive = json['IsActive']; + isDoctorHasPrePostImages = json['IsDoctorHasPrePostImages']; isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; doctorClinicActive = json['DoctorClinicActive']; isbookingAllowed = json['IsbookingAllowed']; @@ -155,6 +158,7 @@ class DoctorProfileList { data['IsRegistered'] = this.isRegistered; data['IsDoctorDummy'] = this.isDoctorDummy; data['IsActive'] = this.isActive; + data['IsDoctorHasPrePostImages'] = this.isDoctorHasPrePostImages; data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; data['DoctorClinicActive'] = this.doctorClinicActive; data['IsbookingAllowed'] = this.isbookingAllowed; diff --git a/lib/models/Appointments/doctor_pre_post_image.dart b/lib/models/Appointments/doctor_pre_post_image.dart new file mode 100644 index 00000000..cb68a472 --- /dev/null +++ b/lib/models/Appointments/doctor_pre_post_image.dart @@ -0,0 +1,107 @@ +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:diplomaticquarterapp/uitl/utils.dart'; + +class DoctorPrePostImages { + DoctorPrePostImageModel pre; + DoctorPrePostImageModel post; + + Uint8List getPreBytes(){ + try{ + var b64 = pre.imageStr.replaceFirst('data:image/png;base64,', ''); + if(pre.imageStr != null && isBase64(b64)) + return Utils.dataFromBase64String(b64); + }catch(e){ + + } + return null; + } + + Uint8List getPostBytes(){ + try{ + var b64 = post.imageStr.replaceFirst('data:image/png;base64,', ''); + if(post.imageStr != null && isBase64(b64)) + return Utils.dataFromBase64String(b64); + }catch(e){ + + } + return null; + } + + bool isBase64(String str) { + RegExp _base64 = RegExp( + r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$'); + return _base64.hasMatch(str); + } +} + +class DoctorPrePostImageModel { + String setupID; + int projectID; + int clinicId; + int doctorId; + int lineItemNo; + String imageStr; + int imageType; + String description; + dynamic isNewUpdated; + bool isActive; + String createdOn; + int createdBy; + dynamic editedOn; + dynamic editedBy; + + DoctorPrePostImageModel({ + this.setupID, + this.projectID, + this.clinicId, + this.doctorId, + this.lineItemNo, + this.imageStr, + this.imageType, + this.description, + this.isNewUpdated, + this.isActive, + this.createdOn, + this.createdBy, + this.editedOn, + this.editedBy}); + + DoctorPrePostImageModel.fromJson(dynamic json) { + setupID = json["SetupID"]; + projectID = json["ProjectID"]; + clinicId = json["ClinicId"]; + doctorId = json["DoctorId"]; + lineItemNo = json["LineItemNo"]; + imageStr = json["ImageStr"]; + imageType = json["ImageType"]; + description = json["Description"]; + isNewUpdated = json["IsNewUpdated"]; + isActive = json["IsActive"]; + createdOn = json["CreatedOn"]; + createdBy = json["CreatedBy"]; + editedOn = json["EditedOn"]; + editedBy = json["EditedBy"]; + } + + Map toJson() { + var map = {}; + map["SetupID"] = setupID; + map["ProjectID"] = projectID; + map["ClinicId"] = clinicId; + map["DoctorId"] = doctorId; + map["LineItemNo"] = lineItemNo; + map["ImageStr"] = imageStr; + map["ImageType"] = imageType; + map["Description"] = description; + map["IsNewUpdated"] = isNewUpdated; + map["IsActive"] = isActive; + map["CreatedOn"] = createdOn; + map["CreatedBy"] = createdBy; + map["EditedOn"] = editedOn; + map["EditedBy"] = editedBy; + return map; + } + +} \ No newline at end of file diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index fd89889f..949f2c44 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/doctor_post_pre_images_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; @@ -14,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_material_pickers/flutter_material_pickers.dart'; import 'package:rating_bar/rating_bar.dart'; import 'BookConfirm.dart'; @@ -176,8 +178,15 @@ class _DoctorProfileState extends State )), ), ), + + if(widget.docProfileList.isDoctorHasPrePostImages == true) + Container( + height: 50, + alignment: Alignment.center, + child: prePostImagesButton(context) + ), + Container( - margin: EdgeInsets.only(top: 10.0), child: Divider( color: Colors.grey[500], ), @@ -225,6 +234,19 @@ class _DoctorProfileState extends State ); } + Widget prePostImagesButton(BuildContext context){ + return Padding( + padding: const EdgeInsets.all(10), + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + onPressed: () => openDoctorPrePostImages(), + child: Text(TranslationBase.of(context).beforeAfterImages, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),), + ), + ); + } + getDoctorRatings() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); @@ -265,6 +287,30 @@ class _DoctorProfileState extends State }); } + openDoctorPrePostImages(){ + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService().getDoctorPrePostImages(widget.docProfileList, context).then((images) { + GifLoaderDialogUtils.hideDialog(context); + showDialog( + context: context, barrierDismissible: true, + builder: (ctx){ + return DoctorPostPreImagesContent(doctorPrePostImages: images); + } + ); + // Navigator.push( + // context, + // FadePage( + // page: DoctorPostPreImagesPage(doctorPrePostImages: images,) + // ) + // ); + + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + void showRatingDialog(List doctorDetailsList) { showGeneralDialog( barrierColor: Colors.black.withOpacity(0.5), @@ -566,4 +612,6 @@ class _DoctorProfileState extends State selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime))); } + + } diff --git a/lib/pages/BookAppointment/doctor_post_pre_images_page.dart b/lib/pages/BookAppointment/doctor_post_pre_images_page.dart new file mode 100644 index 00000000..b97d58ac --- /dev/null +++ b/lib/pages/BookAppointment/doctor_post_pre_images_page.dart @@ -0,0 +1,121 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class DoctorPostPreImagesPage extends StatefulWidget{ + final DoctorPrePostImages doctorPrePostImages; + + const DoctorPostPreImagesPage({this.doctorPrePostImages}); + + @override + State createState() => DoctorPostPreImagesPageState(); +} + +class DoctorPostPreImagesPageState extends State{ + + @override + Widget build(BuildContext context) { + var images = widget.doctorPrePostImages; + return AppScaffold( + appBarTitle: TranslationBase.of(context).beforeAfterImages, + isShowAppBar: true, + isShowDecPage: false, + body: Padding( + padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10), + child: Row( + children: [ + Expanded( + child: Column( + children: [ + Text("Before Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), + Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){ + return Container( + color: Colors.grey.withOpacity(0.25), + ); + },) + ], + ) + ), + Divider(color: Colors.grey.withOpacity(0.5)), + Expanded( + child: Column( + children: [ + Text("After Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), + Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){ + return Container( + color: Colors.grey.withOpacity(0.25), + ); + },) + ], + ) + ) + ], + ), + ) + ); + } + +} + + +class DoctorPostPreImagesContent extends StatefulWidget{ + final DoctorPrePostImages doctorPrePostImages; + + const DoctorPostPreImagesContent({this.doctorPrePostImages}); + + @override + DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState(); +} + +class DoctorPostPreImagesContentState extends State{ + + @override + Widget build(BuildContext context) { + var images = widget.doctorPrePostImages; + return Material( + color: Colors.transparent, + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + Expanded( + child: Column( + children: [ + Text("Before", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), + SizedBox(height: 10,), + Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){ + return Container( + color: Colors.grey.withOpacity(0.25), + ); + },) + ], + ) + ), + Divider(color: Colors.grey.withOpacity(0.5)), + Expanded( + child: Column( + children: [ + Text("After", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), + SizedBox(height: 10,), + Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){ + return Container( + color: Colors.grey.withOpacity(0.25), + ); + },) + ], + ) + ) + ], + ), + ], + ), + ), + ); + } + +} \ No newline at end of file diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 1c0fd13e..c5da90d5 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -64,6 +64,11 @@ class _Login extends State { void initState() { // getDeviceToken(); super.initState(); + + if(BASE_URL.contains("uat.")){ + nationalIDorFile.text = "1231755"; + mobileNumberController.text = mobileNo = "537503378"; + } } getDeviceToken() async { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index fb55d538..b97714ce 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -4,7 +4,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; @@ -157,7 +159,7 @@ class DoctorsListService extends BaseService { "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": authUser.outSA, + "PatientOutSA": authUser.outSA ?? false, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, "SessionID": null, @@ -184,7 +186,7 @@ class DoctorsListService extends BaseService { Future getDoctorsRating(int docID, context) async { Map request; var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -207,13 +209,40 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_DOCTOR_RATING_NOTES, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } + Future getDoctorPrePostImages(DoctorProfileList doctorProfile, context) async { + Map request; + request = { + "PatientOutSA": authUser.outSA ?? 0, + "isDentalAllowedBackend": false, + "DoctorID" : doctorProfile.doctorID, + "ClinicID":doctorProfile.clinicID, + "ProjectID":doctorProfile.projectID + }; + + var images = DoctorPrePostImages(); + await baseAppClient.post(GET_DOCTOR_PRE_POST_IMAGES, + onSuccess: (response, statusCode) async { + var list = response['DoctorPrePostImagesList']; + if (list is List && list.length > 0){ + list.forEach((j) { + var image = DoctorPrePostImageModel.fromJson(j); + if(image.imageType == 1) images.pre = image; + if(image.imageType == 2) images.post = image; + }); + } + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(images); + } + Future getDoctorsRatingDetails(int docID, context) async { Map request; var languageID = diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 795e9228..9ea40910 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -45,6 +45,8 @@ class TranslationBase { String get bookAppo => localizedValues['bookAppo'][locale.languageCode]; + String get beforeAfterImages => localizedValues['beforeAfterImages'][locale.languageCode]; + String get searchBy => localizedValues['searchBy'][locale.languageCode]; String get clinic => localizedValues['clinic'][locale.languageCode]; From e28fdaade1696713836364664ea86d4181644661 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 12 Aug 2021 14:49:09 +0300 Subject: [PATCH 39/39] Dental Invoices implementation completed --- lib/config/config.dart | 6 + .../DentalInvoiceDetailResponse.dart | 489 ++++++++++++++++++ .../my_invoices/invoice_detail_page.dart | 318 +++++++++++- .../medical/my_invoices/my_invoice_page.dart | 44 +- .../my_invoice_services.dart | 92 +++- 5 files changed, 911 insertions(+), 38 deletions(-) create mode 100644 lib/models/MyInvoices/DentalInvoiceDetailResponse.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index acdc5c40..66937944 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -608,6 +608,12 @@ const GET_DOCTOR_LIST_CALCULATION = const GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments"; +const GET_DENTAL_APPOINTMENT_INVOICE = + "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; + +const SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = + "Services/Notifications.svc/REST/SendInvoiceForDental"; + class AppGlobal { static var context; diff --git a/lib/models/MyInvoices/DentalInvoiceDetailResponse.dart b/lib/models/MyInvoices/DentalInvoiceDetailResponse.dart new file mode 100644 index 00000000..83ef9f5a --- /dev/null +++ b/lib/models/MyInvoices/DentalInvoiceDetailResponse.dart @@ -0,0 +1,489 @@ +class DentalInvoiceDetailResponse { + List listEInvoiceForDental; + + DentalInvoiceDetailResponse({this.listEInvoiceForDental}); + + DentalInvoiceDetailResponse.fromJson(Map json) { + if (json['List_eInvoiceForDental'] != null) { + listEInvoiceForDental = new List(); + json['List_eInvoiceForDental'].forEach((v) { + listEInvoiceForDental.add(new ListEInvoiceForDental.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listEInvoiceForDental != null) { + data['List_eInvoiceForDental'] = + this.listEInvoiceForDental.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListEInvoiceForDental { + int projectID; + int doctorID; + dynamic grandTotal; + dynamic quantity; + dynamic total; + dynamic discount; + dynamic subTotal; + int invoiceNo; + String createdOn; + dynamic procedureID; + dynamic procedureName; + dynamic procedureNameN; + dynamic procedurePrice; + dynamic patientShare; + dynamic companyShare; + dynamic totalPatientShare; + dynamic totalCompanyShare; + dynamic totalShare; + dynamic discountAmount; + dynamic vATPercentage; + dynamic patientVATAmount; + dynamic companyVATAmount; + dynamic totalVATAmount; + dynamic price; + int patientID; + String patientName; + dynamic patientNameN; + String nationalityID; + String doctorName; + dynamic doctorNameN; + int clinicID; + String clinicDescription; + dynamic clinicDescriptionN; + String appointmentDate; + int appointmentNo; + String insuranceID; + int companyID; + String companyName; + dynamic companyNameN; + String companyAddress; + dynamic companyAddressN; + String companyGroupAddress; + String groupName; + dynamic groupNameN; + String patientAddress; + String vATNo; + String paymentDate; + String projectName; + dynamic totalDiscount; + dynamic totalPatientShareWithQuantity; + String legalName; + dynamic legalNameN; + dynamic advanceAdjustment; + String doctorImageURL; + List listConsultation; + + ListEInvoiceForDental( + {this.projectID, + this.doctorID, + this.grandTotal, + this.quantity, + this.total, + this.discount, + this.subTotal, + this.invoiceNo, + this.createdOn, + this.procedureID, + this.procedureName, + this.procedureNameN, + this.procedurePrice, + this.patientShare, + this.companyShare, + this.totalPatientShare, + this.totalCompanyShare, + this.totalShare, + this.discountAmount, + this.vATPercentage, + this.patientVATAmount, + this.companyVATAmount, + this.totalVATAmount, + this.price, + this.patientID, + this.patientName, + this.patientNameN, + this.nationalityID, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.appointmentDate, + this.appointmentNo, + this.insuranceID, + this.companyID, + this.companyName, + this.companyNameN, + this.companyAddress, + this.companyAddressN, + this.companyGroupAddress, + this.groupName, + this.groupNameN, + this.patientAddress, + this.vATNo, + this.paymentDate, + this.projectName, + this.totalDiscount, + this.totalPatientShareWithQuantity, + this.legalName, + this.legalNameN, + this.advanceAdjustment, + this.doctorImageURL, + this.listConsultation}); + + ListEInvoiceForDental.fromJson(Map json) { + projectID = json['ProjectID']; + doctorID = json['DoctorID']; + grandTotal = json['GrandTotal']; + quantity = json['Quantity']; + total = json['Total']; + discount = json['Discount']; + subTotal = json['SubTotal']; + invoiceNo = json['InvoiceNo']; + createdOn = json['CreatedOn']; + procedureID = json['ProcedureID']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + procedurePrice = json['ProcedurePrice']; + patientShare = json['PatientShare']; + companyShare = json['CompanyShare']; + totalPatientShare = json['TotalPatientShare']; + totalCompanyShare = json['TotalCompanyShare']; + totalShare = json['TotalShare']; + discountAmount = json['DiscountAmount']; + vATPercentage = json['VATPercentage']; + patientVATAmount = json['PatientVATAmount']; + companyVATAmount = json['CompanyVATAmount']; + totalVATAmount = json['TotalVATAmount']; + price = json['Price']; + patientID = json['PatientID']; + patientName = json['PatientName']; + patientNameN = json['PatientNameN']; + nationalityID = json['NationalityID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + insuranceID = json['InsuranceID']; + companyID = json['CompanyID']; + companyName = json['CompanyName']; + companyNameN = json['CompanyNameN']; + companyAddress = json['CompanyAddress']; + companyAddressN = json['CompanyAddressN']; + companyGroupAddress = json['CompanyGroupAddress']; + groupName = json['GroupName']; + groupNameN = json['GroupNameN']; + patientAddress = json['PatientAddress']; + vATNo = json['VATNo']; + paymentDate = json['PaymentDate']; + projectName = json['ProjectName']; + totalDiscount = json['TotalDiscount']; + totalPatientShareWithQuantity = json['TotalPatientShareWithQuantity']; + legalName = json['LegalName']; + legalNameN = json['LegalNameN']; + advanceAdjustment = json['AdvanceAdjustment']; + doctorImageURL = json['DoctorImageURL']; + if (json['listConsultation'] != null) { + listConsultation = new List(); + json['listConsultation'].forEach((v) { + listConsultation.add(new ListConsultation.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['DoctorID'] = this.doctorID; + data['GrandTotal'] = this.grandTotal; + data['Quantity'] = this.quantity; + data['Total'] = this.total; + data['Discount'] = this.discount; + data['SubTotal'] = this.subTotal; + data['InvoiceNo'] = this.invoiceNo; + data['CreatedOn'] = this.createdOn; + data['ProcedureID'] = this.procedureID; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['ProcedurePrice'] = this.procedurePrice; + data['PatientShare'] = this.patientShare; + data['CompanyShare'] = this.companyShare; + data['TotalPatientShare'] = this.totalPatientShare; + data['TotalCompanyShare'] = this.totalCompanyShare; + data['TotalShare'] = this.totalShare; + data['DiscountAmount'] = this.discountAmount; + data['VATPercentage'] = this.vATPercentage; + data['PatientVATAmount'] = this.patientVATAmount; + data['CompanyVATAmount'] = this.companyVATAmount; + data['TotalVATAmount'] = this.totalVATAmount; + data['Price'] = this.price; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PatientNameN'] = this.patientNameN; + data['NationalityID'] = this.nationalityID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['InsuranceID'] = this.insuranceID; + data['CompanyID'] = this.companyID; + data['CompanyName'] = this.companyName; + data['CompanyNameN'] = this.companyNameN; + data['CompanyAddress'] = this.companyAddress; + data['CompanyAddressN'] = this.companyAddressN; + data['CompanyGroupAddress'] = this.companyGroupAddress; + data['GroupName'] = this.groupName; + data['GroupNameN'] = this.groupNameN; + data['PatientAddress'] = this.patientAddress; + data['VATNo'] = this.vATNo; + data['PaymentDate'] = this.paymentDate; + data['ProjectName'] = this.projectName; + data['TotalDiscount'] = this.totalDiscount; + data['TotalPatientShareWithQuantity'] = this.totalPatientShareWithQuantity; + data['LegalName'] = this.legalName; + data['LegalNameN'] = this.legalNameN; + data['AdvanceAdjustment'] = this.advanceAdjustment; + data['DoctorImageURL'] = this.doctorImageURL; + if (this.listConsultation != null) { + data['listConsultation'] = + this.listConsultation.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListConsultation { + dynamic projectID; + dynamic doctorID; + dynamic grandTotal; + int quantity; + int total; + dynamic discount; + int subTotal; + dynamic invoiceNo; + dynamic createdOn; + String procedureID; + String procedureName; + dynamic procedureNameN; + dynamic procedurePrice; + int patientShare; + dynamic companyShare; + int totalPatientShare; + dynamic totalCompanyShare; + dynamic totalShare; + dynamic discountAmount; + int vATPercentage; + int patientVATAmount; + dynamic companyVATAmount; + dynamic totalVATAmount; + int price; + dynamic patientID; + dynamic patientName; + dynamic patientNameN; + dynamic nationalityID; + dynamic doctorName; + dynamic doctorNameN; + dynamic clinicID; + dynamic clinicDescription; + dynamic clinicDescriptionN; + dynamic appointmentDate; + dynamic appointmentNo; + dynamic insuranceID; + dynamic companyID; + dynamic companyName; + dynamic companyNameN; + dynamic companyAddress; + dynamic companyAddressN; + dynamic companyGroupAddress; + dynamic groupName; + dynamic groupNameN; + dynamic patientAddress; + String vATNo; + dynamic paymentDate; + dynamic projectName; + dynamic totalDiscount; + dynamic totalPatientShareWithQuantity; + dynamic legalName; + dynamic legalNameN; + int advanceAdjustment; + + ListConsultation( + {this.projectID, + this.doctorID, + this.grandTotal, + this.quantity, + this.total, + this.discount, + this.subTotal, + this.invoiceNo, + this.createdOn, + this.procedureID, + this.procedureName, + this.procedureNameN, + this.procedurePrice, + this.patientShare, + this.companyShare, + this.totalPatientShare, + this.totalCompanyShare, + this.totalShare, + this.discountAmount, + this.vATPercentage, + this.patientVATAmount, + this.companyVATAmount, + this.totalVATAmount, + this.price, + this.patientID, + this.patientName, + this.patientNameN, + this.nationalityID, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.appointmentDate, + this.appointmentNo, + this.insuranceID, + this.companyID, + this.companyName, + this.companyNameN, + this.companyAddress, + this.companyAddressN, + this.companyGroupAddress, + this.groupName, + this.groupNameN, + this.patientAddress, + this.vATNo, + this.paymentDate, + this.projectName, + this.totalDiscount, + this.totalPatientShareWithQuantity, + this.legalName, + this.legalNameN, + this.advanceAdjustment}); + + ListConsultation.fromJson(Map json) { + projectID = json['ProjectID']; + doctorID = json['DoctorID']; + grandTotal = json['GrandTotal']; + quantity = json['Quantity']; + total = json['Total']; + discount = json['Discount']; + subTotal = json['SubTotal']; + invoiceNo = json['InvoiceNo']; + createdOn = json['CreatedOn']; + procedureID = json['ProcedureID']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + procedurePrice = json['ProcedurePrice']; + patientShare = json['PatientShare']; + companyShare = json['CompanyShare']; + totalPatientShare = json['TotalPatientShare']; + totalCompanyShare = json['TotalCompanyShare']; + totalShare = json['TotalShare']; + discountAmount = json['DiscountAmount']; + vATPercentage = json['VATPercentage']; + patientVATAmount = json['PatientVATAmount']; + companyVATAmount = json['CompanyVATAmount']; + totalVATAmount = json['TotalVATAmount']; + price = json['Price']; + patientID = json['PatientID']; + patientName = json['PatientName']; + patientNameN = json['PatientNameN']; + nationalityID = json['NationalityID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + insuranceID = json['InsuranceID']; + companyID = json['CompanyID']; + companyName = json['CompanyName']; + companyNameN = json['CompanyNameN']; + companyAddress = json['CompanyAddress']; + companyAddressN = json['CompanyAddressN']; + companyGroupAddress = json['CompanyGroupAddress']; + groupName = json['GroupName']; + groupNameN = json['GroupNameN']; + patientAddress = json['PatientAddress']; + vATNo = json['VATNo']; + paymentDate = json['PaymentDate']; + projectName = json['ProjectName']; + totalDiscount = json['TotalDiscount']; + totalPatientShareWithQuantity = json['TotalPatientShareWithQuantity']; + legalName = json['LegalName']; + legalNameN = json['LegalNameN']; + advanceAdjustment = json['AdvanceAdjustment']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['DoctorID'] = this.doctorID; + data['GrandTotal'] = this.grandTotal; + data['Quantity'] = this.quantity; + data['Total'] = this.total; + data['Discount'] = this.discount; + data['SubTotal'] = this.subTotal; + data['InvoiceNo'] = this.invoiceNo; + data['CreatedOn'] = this.createdOn; + data['ProcedureID'] = this.procedureID; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + data['ProcedurePrice'] = this.procedurePrice; + data['PatientShare'] = this.patientShare; + data['CompanyShare'] = this.companyShare; + data['TotalPatientShare'] = this.totalPatientShare; + data['TotalCompanyShare'] = this.totalCompanyShare; + data['TotalShare'] = this.totalShare; + data['DiscountAmount'] = this.discountAmount; + data['VATPercentage'] = this.vATPercentage; + data['PatientVATAmount'] = this.patientVATAmount; + data['CompanyVATAmount'] = this.companyVATAmount; + data['TotalVATAmount'] = this.totalVATAmount; + data['Price'] = this.price; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PatientNameN'] = this.patientNameN; + data['NationalityID'] = this.nationalityID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['InsuranceID'] = this.insuranceID; + data['CompanyID'] = this.companyID; + data['CompanyName'] = this.companyName; + data['CompanyNameN'] = this.companyNameN; + data['CompanyAddress'] = this.companyAddress; + data['CompanyAddressN'] = this.companyAddressN; + data['CompanyGroupAddress'] = this.companyGroupAddress; + data['GroupName'] = this.groupName; + data['GroupNameN'] = this.groupNameN; + data['PatientAddress'] = this.patientAddress; + data['VATNo'] = this.vATNo; + data['PaymentDate'] = this.paymentDate; + data['ProjectName'] = this.projectName; + data['TotalDiscount'] = this.totalDiscount; + data['TotalPatientShareWithQuantity'] = this.totalPatientShareWithQuantity; + data['LegalName'] = this.legalName; + data['LegalNameN'] = this.legalNameN; + data['AdvanceAdjustment'] = this.advanceAdjustment; + return data; + } +} diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 33df8fc3..3d62a661 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -1,8 +1,14 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/MyInvoices/DentalInvoiceDetailResponse.dart'; import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_services.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -10,23 +16,37 @@ import 'package:provider/provider.dart'; class InvoiceDetail extends StatelessWidget { final DoctorList doctor; final ListDentalAppointments listDentalAppointments; + final DentalInvoiceDetailResponse dentalInvoiceDetailResponse; + final BuildContext context; - InvoiceDetail(this.doctor, this.listDentalAppointments); + int totalServiceRate = 0; + int totalDiscount = 0; + int totalVAT = 0; + int subTotal = 0; + int grandTotal = 0; + + InvoiceDetail(this.doctor, this.listDentalAppointments, + this.dentalInvoiceDetailResponse, this.context); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - appBarTitle: TranslationBase.of(context).myInvoice, - isShowAppBar: true, - isShowDecPage: false, - body: Container( + appBarTitle: TranslationBase.of(context).myInvoice, + isShowAppBar: true, + isShowDecPage: false, + body: SingleChildScrollView( + child: Container( child: Column( children: [ - DoctorView(doctor: doctor, isLiveCareAppointment: false, isShowFlag: false), + DoctorView( + doctor: doctor, + isLiveCareAppointment: false, + isShowFlag: false), Container( - margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - padding: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0, bottom: 10.0), + margin: EdgeInsets.only(left: 10.0, right: 10.0), + padding: EdgeInsets.only( + top: 10.0, left: 10.0, right: 10.0, bottom: 10.0), decoration: BoxDecoration( color: Colors.grey[800], borderRadius: BorderRadius.only( @@ -34,18 +54,286 @@ class InvoiceDetail extends StatelessWidget { topRight: Radius.circular(8), ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + child: Table( children: [ - Text("Description", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), - Text("Quantity", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), - Text("Price", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), - Text("Total", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), + TableRow(children: [ + Text("Description", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold)), + Text("Quantity", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold)), + Text("Price", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold)), + Text("Total", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold)), + ]), ], ), ), + Container( + margin: EdgeInsets.only(top: 0.0, left: 10.0, right: 10.0), + padding: EdgeInsets.only( + top: 10.0, left: 10.0, right: 10.0, bottom: 15.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + )), + child: Table(children: fullData(context)), + ), + Container( + margin: EdgeInsets.only(top: 3.0, left: 12.0, right: 12.0), + child: Divider( + color: Colors.grey[400], + thickness: 0.7, + ), + ), + Container( + child: AppExpandableNotifier( + title: "Total Price: " + grandTotal.toString() + " SAR", + isExpand: true, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Table( + children: [ + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Discount: ", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(totalDiscount.toString() + " SAR", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + "VAT (" + + dentalInvoiceDetailResponse + .listEInvoiceForDental[0] + .listConsultation[0] + .vATPercentage + .toString() + + "%)", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(totalVAT.toString() + " SAR", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Total: ", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(grandTotal.toString() + " SAR", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Paid: ", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: + EdgeInsets.only(top: 10.0, bottom: 10.0), + child: Text(grandTotal.toString() + " SAR", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + ]), + ], + ), + ]), + ), + ), + Container( + margin: EdgeInsets.only(top: 3.0, left: 12.0, right: 12.0), + child: Divider( + color: Colors.grey[400], + thickness: 0.7, + ), + ), + Container( + margin: EdgeInsets.only(top: 0.0, left: 10.0, right: 10.0), + padding: EdgeInsets.only( + top: 10.0, left: 10.0, right: 10.0, bottom: 15.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(8))), + child: Table(children: [ + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Insurance: ", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0, bottom: 5.0), + child: Text( + dentalInvoiceDetailResponse + .listEInvoiceForDental[0].companyName, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("Insurance ID: ", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(top: 10.0, bottom: 10.0), + child: Text( + dentalInvoiceDetailResponse + .listEInvoiceForDental[0].insuranceID, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + ]), + ]), + ), + SizedBox( + height: 100.0, + ), ], ), - )); + ), + ), + bottomSheet: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), + child: Button( + onTap: () { + sendInvoiceEmail(); + }, + label: TranslationBase.of(context).sendEmail, + backgroundColor: Colors.red[900], + ), + ), + ); + } + + sendInvoiceEmail() { + GifLoaderDialogUtils.showMyDialog(context); + MyInvoicesService myInvoicesService = new MyInvoicesService(); + + myInvoicesService + .sendDentalAppointmentInvoiceEmail( + 12, listDentalAppointments.appointmentNo, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast( + message: TranslationBase.of(context).emailSentSuccessfully); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }); + } + + List fullData(context) { + List tableRow = []; + dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation + .forEach((lab) { + tableRow.add( + TableRow(children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(lab.procedureName, + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, fontWeight: FontWeight.w400)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(lab.quantity.toString(), + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, fontWeight: FontWeight.w400)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(lab.price.toString() + " SAR", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, fontWeight: FontWeight.w400)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(lab.total.toString() + " SAR", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.black, fontWeight: FontWeight.w400)), + ), + ]), + ); + }); + return tableRow; } } diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index 898d374a..2af80adc 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart' as DoctorListResponse; +import 'package:diplomaticquarterapp/models/MyInvoices/DentalInvoiceDetailResponse.dart'; import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; import 'package:diplomaticquarterapp/pages/medical/my_invoices/invoice_detail_page.dart'; import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_services.dart'; @@ -21,6 +22,7 @@ class MyInvoices extends StatefulWidget { class _MyInvoicesState extends State { bool isDataLoaded = false; GetDentalAppointmentsResponse getDentalAppointmentsResponse; + DentalInvoiceDetailResponse dentalInvoiceDetailResponse; @override void initState() { @@ -36,7 +38,7 @@ class _MyInvoicesState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).myInvoice, isShowAppBar: true, - isShowDecPage: false, + isShowDecPage: true, body: Container( child: SingleChildScrollView( physics: BouncingScrollPhysics(), @@ -186,6 +188,9 @@ class _MyInvoicesState extends State { } openInvoiceDetailsPage(ListDentalAppointments listDentalAppointments) { + GifLoaderDialogUtils.showMyDialog(context); + MyInvoicesService myInvoicesService = new MyInvoicesService(); + DoctorListResponse.DoctorList doctor = new DoctorListResponse.DoctorList(); doctor.name = listDentalAppointments.doctorName; @@ -197,13 +202,33 @@ class _MyInvoicesState extends State { doctor.doctorTitle = "Dr."; doctor.clinicName = "InvoiceNo: " + listDentalAppointments.invoiceNo.toString(); - Navigator.push( - context, - FadePage( - page: InvoiceDetail( - doctor, - listDentalAppointments, - ))); + myInvoicesService.getDentalAppointmentInvoice(12, listDentalAppointments.appointmentNo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + dentalInvoiceDetailResponse = + DentalInvoiceDetailResponse.fromJson(res); + print(dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length); + Navigator.push( + context, + FadePage( + page: InvoiceDetail( + doctor, + listDentalAppointments, + dentalInvoiceDetailResponse, + context + ))); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + isDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err.toString()); + Navigator.of(context).pop(); + }); } getDentalAppointments() { @@ -216,9 +241,6 @@ class _MyInvoicesState extends State { if (res['MessageStatus'] == 1) { getDentalAppointmentsResponse = GetDentalAppointmentsResponse.fromJson(res); - print(getDentalAppointmentsResponse.listDentalAppointments.length); - print(getDentalAppointmentsResponse - .listDentalAppointments[0].appointmentNo); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } diff --git a/lib/services/my_invoice_service/my_invoice_services.dart b/lib/services/my_invoice_service/my_invoice_services.dart index fc401c39..69d3ea19 100644 --- a/lib/services/my_invoice_service/my_invoice_services.dart +++ b/lib/services/my_invoice_service/my_invoice_services.dart @@ -13,11 +13,10 @@ class MyInvoicesService extends BaseService { AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); - Future getAllDentalAppointments(int projectID, - context) async { + Future getAllDentalAppointments(int projectID, context) async { Map request; var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -32,22 +31,91 @@ class MyInvoicesService extends BaseService { "License": true, "IsRegistered": true, "ProjectID": projectID, - "PatientTypeID":authUser.patientIdentificationType, - "PatientType":authUser.patientType, + "PatientTypeID": authUser.patientIdentificationType, + "PatientType": authUser.patientType, "isDentalAllowedBackend": false }; dynamic localRes; await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, - onSuccess: (response, statusCode) async { - localRes = response; + onSuccess: (response, statusCode) async { + localRes = response; }, onFailure: (String error, int statusCode) { - throw error; + throw error; }, body: request); - return Future.value( - localRes - ); + return Future.value(localRes); + } + + Future getDentalAppointmentInvoice(int projectID, int appoNo, context) async { + Map request; + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "PatientID": authUser.patientID, + "License": true, + "AppointmentNo": appoNo, + "IsRegistered": true, + "ProjectID": projectID, + "PatientTypeID": authUser.patientIdentificationType, + "PatientType": authUser.patientType, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DENTAL_APPOINTMENT_INVOICE, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future sendDentalAppointmentInvoiceEmail(int projectID, int appoNo, context) async { + Map request; + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null, + "PatientID": authUser.patientID, + "License": true, + "AppointmentNo": appoNo, + "To": authUser.emailAddress, + "IsRegistered": true, + "ProjectID": projectID, + "PatientTypeID": authUser.patientIdentificationType, + "PatientType": authUser.patientType, + "isDentalAllowedBackend": false + }; + + dynamic localRes; + + await baseAppClient.post(SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); } -} \ No newline at end of file +}