From 5fb92c78160ee33feca9117c574b6debf2c8537f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 3 Mar 2021 18:21:13 +0300 Subject: [PATCH 01/13] 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/13] 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/13] 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/13] 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/13] 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/13] 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/13] 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/13] 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/13] 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/13] 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 1ed76e91aa8c71e08ffdafbe4306ca5487747e0d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 4 Aug 2021 14:28:58 +0300 Subject: [PATCH 11/13] 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 12/13] 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 e9dbc4be7af1af5922f8538d7212a404b036c892 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 4 Aug 2021 16:26:49 +0300 Subject: [PATCH 13/13] fix bugs --- .../health_converter/blood_sugar.dart | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart index 27c89383..e429418d 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -42,6 +42,7 @@ class _BloodSugarState extends State { } void calculateBloodSugar() { + if (textController.text.isEmpty) return; if (cardMGColor == activeCardColor) { inputValue = double.parse(textController.text); inputValue = inputValue / 15; @@ -60,10 +61,18 @@ class _BloodSugarState extends State { double inputValue = 0; String unit; + @override + void initState() { + updateColor(1); + unit = 'mmol/l'; + super.initState(); + } + @override Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, + isShowDecPage: false, appBarTitle: TranslationBase.of(context).bloodSugarConversion, body: Padding( padding: const EdgeInsets.all(16.0), @@ -112,8 +121,11 @@ class _BloodSugarState extends State { onTap: () { setState(() { updateColor(1); - inputValue = double.parse(textController.text); - inputValue = inputValue / 15; + if (textController.text.isNotEmpty) { + inputValue = + double.parse(textController.text); + inputValue = inputValue / 15; + } unit = 'mmol/l'; }); }, @@ -126,14 +138,16 @@ class _BloodSugarState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow + offset: Offset( + 0, 3), // changes position of shadow ), ], color: cardMGColor, borderRadius: BorderRadius.circular(3.0), ), child: Padding( - padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), child: Texts('MG/DLt TO \nMMOL/L'), ), ), @@ -142,8 +156,11 @@ class _BloodSugarState extends State { onTap: () { setState(() { updateColor(2); - inputValue = double.parse(textController.text); - inputValue = inputValue * 18; + if (textController.text.isNotEmpty) { + inputValue = + double.parse(textController.text); + inputValue = inputValue / 18; + } unit = 'mg/dlt'; }); }, @@ -158,12 +175,14 @@ class _BloodSugarState extends State { color: Colors.grey.withOpacity(0.5), spreadRadius: 3, blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow + offset: Offset( + 0, 3), // changes position of shadow ), ], ), child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), + padding: const EdgeInsets.symmetric( + horizontal: 16.0), child: Texts('\nMMOL/L TO MG/DLt '), ), ), @@ -191,7 +210,8 @@ class _BloodSugarState extends State { keyboardType: TextInputType.number, decoration: InputDecoration( labelText: TranslationBase.of(context).enterReadingValue, - border: OutlineInputBorder(borderSide: BorderSide(color: Colors.black45)), + border: OutlineInputBorder( + borderSide: BorderSide(color: Colors.black45)), labelStyle: TextStyle( color: Colors.black87, ), @@ -253,7 +273,9 @@ class _BloodSugarState extends State { label: TranslationBase.of(context).calculate, onTap: () { setState(() { - _visible == false ? _visible = !_visible : _visible = _visible; + _visible == false + ? _visible = !_visible + : _visible = _visible; calculateBloodSugar(); }); },