From 680dcfc255de48abc64d1d492824729c2639946c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Oct 2021 17:19:10 +0300 Subject: [PATCH 1/5] In App Review --- lib/widgets/drawer/app_drawer_widget.dart | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 6209f52d..a66d5850 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -34,6 +34,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:in_app_review/in_app_review.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -47,6 +48,7 @@ class AppDrawer extends StatefulWidget { } class _AppDrawerState extends State { + final InAppReview _inAppReview = InAppReview.instance; @override void initState() { @@ -377,11 +379,12 @@ class _AppDrawerState extends State { InkWell( child: DrawerItem(TranslationBase.of(context).rateApp, Icons.star, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider), onTap: () { - if (Platform.isIOS) { - launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); - } else { - launch("https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); - } + openAppReviewDialog(); + // if (Platform.isIOS) { + // launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); + // } else { + // launch("https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); + // } }, ), InkWell( @@ -607,6 +610,12 @@ class _AppDrawerState extends State { }); } + openAppReviewDialog() async { + if (await _inAppReview.isAvailable()) { + _inAppReview.requestReview(); + } + } + void setUserValues(value) async { if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); } From 5b1f0c163e41d3f6e973b7dcd8bf8a6ed34f0cbf Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Oct 2021 17:19:25 +0300 Subject: [PATCH 2/5] In App Review --- pubspec.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pubspec.yaml b/pubspec.yaml index 15c10362..49700d97 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -189,6 +189,8 @@ dependencies: in_app_update: ^1.1.15 + in_app_review: ^1.0.4 + badges: ^1.1.4 # open_settings: ^2.0.1 # Dep by Zohaib From 3db40945854e51496e315d8a0ebb1c5bd5792892 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 21 Oct 2021 16:03:58 +0300 Subject: [PATCH 3/5] Ereferral fixed, HHC moved to new APIs, Notification new design implemented --- lib/config/config.dart | 1 + lib/config/localized_values.dart | 42 ++++--- .../e_referral_service.dart | 4 + .../home_health_care_service.dart | 10 ++ .../home_health_care_view_model.dart | 3 +- .../e_referral_view_model.dart | 2 +- .../new_e_referral_step_one_page.dart | 11 +- .../new_e_referral_step_three_page.dart | 35 +++--- .../new_e_referral_step_two_page.dart | 2 +- .../E-Referral/referral_details.dart | 50 ++------- .../new_home_health_care_page.dart | 16 ++- .../orders_log_details_page.dart | 2 +- .../all_habib_medical_service_page2.dart | 36 +++--- .../health-weather-indicator.dart | 12 +- .../notifications/notifications_page.dart | 106 ++++-------------- .../fragments/home_page_fragment2.dart | 10 +- lib/pages/landing/home_page_2.dart | 2 +- lib/pages/login/login.dart | 2 +- lib/uitl/translations_delegate_base.dart | 46 +++++++- lib/widgets/bottom_options/BottomSheet.dart | 4 +- 20 files changed, 190 insertions(+), 206 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 75a904ea..7270f91e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -442,6 +442,7 @@ const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/ const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc"; const ADD_HHC_ORDER_RC = "rc/api/HHC/add"; const GET_ALL_HHC_ORDERS_RC = 'rc/api/hhc/list'; +const UPDATE_HHC_ORDER_RC = 'rc/api/hhc/update'; // CMC RC SERVICES const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index bb910f6c..b4c0df07 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -633,7 +633,7 @@ const Map localizedValues = { "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي) ..." }, "email": {"en": "Email", "ar": "البريد الالكتروني"}, - "Book": {"en": "Book", "ar": "احجز"}, + "Book": {"en": "Book", "ar": "حجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, "marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"}, @@ -1092,7 +1092,7 @@ const Map localizedValues = { "updated-email": {"en": "Updated email successfully", "ar": "تم تحديث البريد الالكتروني"}, "view-list-children": {"en": "View List of Children", "ar": "عرض قائمة الأطفال"}, "covidTest": {"en": "COVID-19 TEST", "ar": "فحص كورونا"}, - "driveThru": {"en": "Drive-Thru", "ar": "من السيارة"}, + "driveThru": {"en": "Drive-Thru", "ar": "من داخل السيارة"}, "trackDeliveryDriver": {"en": "Track Delivery Driver", "ar": "تتبع السائق"}, "NearestErDesc": { "en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", @@ -1542,24 +1542,40 @@ const Map localizedValues = { "My_File_Details": {"en": "My File Details", "ar": "تفاصيل ملفي"}, "Ecommerce": {"en": "Ecommerce", "ar": "التجارة الإلكترونية"}, "Family_Files": {"en": "Family Files", "ar": "ملفات العائلة"}, - "My_Child": {"en": "My Child", "ar": "طفلي"}, - "Vaccines": {"en": "Vaccines", "ar": "اللقاحات"}, - "Todo": {"en": "Todo", "ar": "لكى يفعل"}, - "List": {"en": "List", "ar": "قائمة"}, - "Blood": {"en": "Blood", "ar": "دم"}, - "Donation": {"en": "Donation", "ar": "هبة"}, + "My_Child": {"en": "My Child", "ar": "تطعيمات"}, + "Vaccines": {"en": "Vaccines", "ar": "الأطفال"}, + "Todo": {"en": "Todo", "ar": "قائمة"}, + "List": {"en": "List", "ar": "المهام"}, + "Blood": {"en": "Blood", "ar": "التبرع"}, + "Donation": {"en": "Donation", "ar": "بالدم"}, "Health": {"en": "Health", "ar": "الصحة"}, "Calculator": {"en": "Calculator", "ar": "آلة حاسبة"}, "Converter": {"en": "Converter", "ar": "محول"}, "Smart": {"en": "Smart", "ar": "ذكي"}, "Watches": {"en": "Watches", "ar": "ساعات"}, - "Parking": {"en": "Parking", "ar": "موقف سيارات"}, + "parkingTitle2": {"en": "Car parking", "ar": "خدمة"}, + "ParkingSubtitle": {"en": "service", "ar": "مواقف السيارات"}, "Details": {"en": "Details", "ar": "تفاصيل"}, - "Virtual": {"en": "Virtual", "ar": "افتراضية"}, - "News": {"en": "News", "ar": "أخبار"}, - "Latest": {"en": "Latest", "ar": "أحدث"}, - "Tour": {"en": "Tour", "ar": "رحلة"}, + "News": {"en": "News", "ar": "أحدث"}, + "Latest": {"en": "Latest", "ar": "ألاخبار"}, + "Virtual": {"en": "Virtual", "ar": "جولة"}, + "Tour": {"en": "Tour", "ar": "افتراضية"}, "mostViewed": {"en": "Most Viewed", "ar": "الأكثر مشاهدة"}, "newProducts": {"en": "New Products", "ar": "منتجات جديدة"}, "paymentSelected": {"en": "Selected", "ar": "المحدد"}, + "moreNotifications": {"en": "More notifications", "ar": "الإشعارات المزيد"}, + "familyTitle": {"en": "My Family", "ar": "ملفات"}, + "familySubtitle": {"en": "Files", "ar": "العائلة"}, + "liveCareTitle": {"en": "LiveCare", "ar": "خدمة"}, + "liveCareSubtitle": {"en": "Service", "ar": "لايف كير"}, + "pharmacyTitle": {"en": "Al Habib", "ar": "الصيدليات"}, + "pharmacySubtitle": {"en": "Pharmacy", "ar": "الحبيب"}, + "healthCalculatorTitle": {"en": "Health", "ar": "الحاسبات"}, + "healthCalculatorSubtitle": {"en": "Calculators", "ar": "الصحية"}, + "waterTitle": {"en": "Water", "ar": "استهلاك"}, + "waterSubtitle": {"en": "Consumption", "ar": "الماء"}, + "medicalFileTitle2": {"en": "My Medical File", "ar": "تفاصيل"}, + "medicalFileSubtitle": {"en": "Details", "ar": "ملفي الطبي"}, + "healthConvertersTitle": {"en": "Health", "ar": "تحويل"}, + "healthConvertersSubtitle": {"en": "Converters", "ar": "القياسات"}, }; diff --git a/lib/core/service/AlHabibMedicalService/e_referral_service.dart b/lib/core/service/AlHabibMedicalService/e_referral_service.dart index 7fcc5f19..f3791f4b 100644 --- a/lib/core/service/AlHabibMedicalService/e_referral_service.dart +++ b/lib/core/service/AlHabibMedicalService/e_referral_service.dart @@ -22,9 +22,12 @@ class EReferralService extends BaseService { List get allReferral => _allReferral; String _activationCode; String _logInTokenID; + String _referralNumber; String get activationCode => _activationCode; + String get referralNumber => _referralNumber; + bool _isActivationCodeValid = false; bool get isActivationCodeValid => _isActivationCodeValid; @@ -106,6 +109,7 @@ class EReferralService extends BaseService { CREATE_E_REFERRAL /*'Services/Patients.svc/REST/CreateEReferral'*/, onSuccess: (dynamic response, int statusCode) { // TODO Waiting for fix service + _referralNumber = response['ReferralNumber'].toString(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart index 00d44f6a..cd90dae5 100644 --- a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -104,6 +104,16 @@ class HomeHealthCareService extends BaseService { }, body: updatePresOrderRequestModel.toJson()); } + Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { + hasError = false; + await baseAppClient.post(UPDATE_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { + isOrderUpdated = true; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: updatePresOrderRequestModel.toJson()); + } + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async { hasError = false; await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index d27827e4..09b2a73d 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -71,7 +71,8 @@ class HomeHealthCareViewModel extends BaseViewModel { Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { setState(ViewState.Busy); - await _homeHealthCareService.updateHHCPresOrder(updatePresOrderRequestModel); + // await _homeHealthCareService.updateHHCPresOrder(updatePresOrderRequestModel); + await _homeHealthCareService.updateHHCPresOrderRC(updatePresOrderRequestModel); if (_homeHealthCareService.hasError) { error = _homeHealthCareService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart index b1a6441e..ee803b5e 100644 --- a/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart +++ b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart @@ -21,7 +21,7 @@ class EReferralViewModel extends BaseViewModel { List get allCities => _eReferralService.allCities; List get allReferral => _eReferralService.allReferral; - + String get referralNumber => _eReferralService.referralNumber; void getRelationTypes() async { setState(ViewState.Busy); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 16f599d7..25efb016 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -36,6 +36,7 @@ class NewEReferralStepOnePage extends StatefulWidget { class _NewEReferralStepOnePageState extends State { TextEditingController _nameTextController = TextEditingController(); + TextEditingController _requesterRelationTextController = TextEditingController(); GetAllRelationshipTypeResponseModel _selectedRelation; String email; @@ -166,6 +167,11 @@ class _NewEReferralStepOnePageState extends State { ), ), ), + SizedBox( + height: 12, + ), + if (_selectedRelation != null && _selectedRelation.iD == 5) + inputWidget(TranslationBase.of(context).requesterRelationship, "", _requesterRelationTextController, isInputTypeNum: false), ], ), ), @@ -180,7 +186,7 @@ class _NewEReferralStepOnePageState extends State { width: double.infinity, child: DefaultButton( TranslationBase.of(context).next, - (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty) + (_nameTextController.text.isEmpty || _selectedRelation == null || mobileNo.isEmpty || (_selectedRelation.iD == 5 && _requesterRelationTextController.text.isEmpty)) ? null : () async { Future.delayed(new Duration(milliseconds: 300)).then((value) async { @@ -222,7 +228,8 @@ class _NewEReferralStepOnePageState extends State { Navigator.of(context).pop(); widget.changePageViewIndex(1); widget.createEReferralRequestModel.requesterName = _nameTextController.text; - widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + mobileNo; + widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString() + mobileNo; + widget.createEReferralRequestModel.otherRelationship = _requesterRelationTextController.text; widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD; } }); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index 164d7b50..439a9ec7 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -7,11 +7,11 @@ import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -22,7 +22,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import '../dialogs/select_city_dialog.dart'; @@ -111,11 +110,10 @@ class _NewEReferralStepThreePageState extends State { fontWeight: FontWeight.w600, ), ), - ...List.generate( medicalReportImages.length, (index) => Container( - padding: EdgeInsets.only(top: 6,bottom: 6), + padding: EdgeInsets.only(top: 6, bottom: 6), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -154,7 +152,7 @@ class _NewEReferralStepThreePageState extends State { ); }, child: Padding( - padding: EdgeInsets.only(top: 12,bottom: 12), + padding: EdgeInsets.only(top: 12, bottom: 12), child: Text( TranslationBase.of(context).selectAttachment, style: TextStyle( @@ -257,10 +255,8 @@ class _NewEReferralStepThreePageState extends State { Padding( padding: const EdgeInsets.all(5.0), child: Text( - TranslationBase.of(context).insuredPatientReferral, style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600 - ), + TranslationBase.of(context).insuredPatientReferral, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600), ), ), ], @@ -297,11 +293,10 @@ class _NewEReferralStepThreePageState extends State { fontWeight: FontWeight.w600, ), ), - ...List.generate( insuredPatientImages.length, (index) => Container( - padding: EdgeInsets.only(top: 6,bottom: 6), + padding: EdgeInsets.only(top: 6, bottom: 6), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -339,7 +334,7 @@ class _NewEReferralStepThreePageState extends State { }); }, child: Padding( - padding: const EdgeInsets.only(top: 12,bottom: 12), + padding: const EdgeInsets.only(top: 12, bottom: 12), child: Text( TranslationBase.of(context).selectAttachment, style: TextStyle( @@ -378,16 +373,23 @@ class _NewEReferralStepThreePageState extends State { this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length != 0 ? insuredPatientImages[0] : null; this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured; // ToDo make the preferred Branch info dynamic - this.widget.createEReferralRequestModel.preferredBranchCode = num.tryParse(projectDropdownValue.split(",")[0]); - this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue.split(",")[1]; - this.widget.createEReferralRequestModel.otherRelationship = ""; + this.widget.createEReferralRequestModel.preferredBranchCode = projectDropdownValue != null && projectDropdownValue.isNotEmpty ? num.tryParse(projectDropdownValue.split(",")[0]) : 0; + this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue != null && projectDropdownValue.isNotEmpty ? projectDropdownValue.split(",")[1] : ""; + // this.widget.createEReferralRequestModel.otherRelationship = ""; await model.createEReferral(this.widget.createEReferralRequestModel); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Utils.showErrorToast(model.error); } else { GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast(message: TranslationBase.of(context).ereferralSaveSuccess); + // AppToast.showSuccessToast(message: TranslationBase.of(context).ereferralSaveSuccess); + showCMCConfirmDialog( + context, + model.referralNumber, + onClick: () { + Navigator.pop(context); + }, + ); } }); }, @@ -469,7 +471,6 @@ class _NewEReferralStepThreePageState extends State { ); } - String getRelationName() { if (_selectedCity != null) return _selectedCity.description; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 9135eda9..57341838 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -180,7 +180,7 @@ class _NewEReferralStepTowPageState extends State { this.widget.changePageViewIndex(2); this.widget.createEReferralRequestModel.identificationNo = int.parse(_patientIdentificationTextController.text); this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text; - this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1) + mobileNo; + this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString() + mobileNo; this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString(); this.widget.createEReferralRequestModel.cityName = _selectedCity.description; }, diff --git a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart b/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart index fe920748..1baab531 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart @@ -31,8 +31,7 @@ class _ReferralDetailsState extends State { width: double.infinity, child: Container( decoration: cardRadius(12), - margin: - EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), + margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), child: Padding( padding: const EdgeInsets.all(15.0), child: Column( @@ -40,13 +39,7 @@ class _ReferralDetailsState extends State { children: [ Container( margin: EdgeInsets.only(bottom: 10.0), - child: Text( - TranslationBase.of(context).ereferral, - style: TextStyle( - letterSpacing: -0.64, - color: Colors.black, - fontSize: 18.0, - fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).ereferral, style: TextStyle(letterSpacing: -0.64, color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold)), ), Container( width: double.infinity, @@ -54,15 +47,10 @@ class _ReferralDetailsState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).referralStatus), + child: _getNormalText(TranslationBase.of(context).referralStatus), ), Expanded( - child: _getNormalText( - projectViewModel.isArabic - ? widget.referral.statusAr - : widget.referral.status, - isBold: true), + child: _getNormalText(projectViewModel.isArabic ? widget.referral.statusAr : widget.referral.status, isBold: true), ) ], ), @@ -74,13 +62,10 @@ class _ReferralDetailsState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).patientName), + child: _getNormalText(TranslationBase.of(context).patientName), ), Expanded( - child: _getNormalText( - widget.referral.patientName, - isBold: true), + child: _getNormalText(widget.referral.patientName, isBold: true), ) ], ), @@ -92,13 +77,10 @@ class _ReferralDetailsState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).referralNumber), + child: _getNormalText(TranslationBase.of(context).referralNumber), ), Expanded( - child: _getNormalText( - widget.referral.referralNumber.toString(), - isBold: true), + child: _getNormalText(widget.referral.referralNumber.toString(), isBold: true), ) ], ), @@ -110,15 +92,10 @@ class _ReferralDetailsState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).referralDate), + child: _getNormalText(TranslationBase.of(context).referralDate), ), Expanded( - child: _getNormalText( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDateNoTimeZone( - widget.referral.referralDate)), - isBold: true), + child: _getNormalText(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(widget.referral.referralDate)), isBold: true), ) ], ), @@ -130,13 +107,10 @@ class _ReferralDetailsState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).hospital), + child: _getNormalText(TranslationBase.of(context).hospital), ), Expanded( - child: _getNormalText( - widget.referral.preferredBranchName, - isBold: true), + child: _getNormalText(widget.referral.preferredBranchName ?? "", isBold: true), ) ], ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart index c4e82766..b0e98ce4 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -1,17 +1,15 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:provider/provider.dart'; @@ -66,14 +64,14 @@ class _NewHomeHealthCarePageState extends State with Tick @override Widget build(BuildContext context) { - void showConfirmMessage(HomeHealthCareViewModel model, GetOrderDetailByOrderIDResponseModel order) { + void showConfirmMessage(HomeHealthCareViewModel model, GetCMCAllOrdersResponseModel order) { showDialog( context: context, - child: ConfirmCancelOrderDialog( - model: model, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).cancelOrderMsg, onTap: () async { model.setState(ViewState.Busy); - UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3); + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3); await model.updateHHCPresOrder(updatePresOrderRequestModel); if (model.state == ViewState.ErrorLocal) { @@ -195,7 +193,7 @@ class _NewHomeHealthCarePageState extends State with Tick if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2) InkWell( onTap: () { - showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); + showConfirmMessage(widget.model, widget.model.pendingOrder); }, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 919c566a..22ffd68f 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -90,7 +90,7 @@ class OrdersLogDetailsPage extends StatelessWidget { } else if (status == 3) { //completed _color = Color(0xff359846); - } else if (status == 4) { + } else if (status == 4 || status == 6 || status == 7) { //cancel // Rejected _color = Color(0xffD02127); } diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart index 6aff12d7..fc3eebb5 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart @@ -48,29 +48,29 @@ class _AllHabibMedicalSevicePage2State extends State initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCareTitle, TranslationBase.of(context).liveCareSubtitle, "assets/images/new/Live_Care.svg", isLogin)); hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin)); hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); hmgServices.add(new HmgServices(8, TranslationBase.of(context).findUs, TranslationBase.of(context).reachUs, "assets/images/new/reach_us.svg", isLogin)); - hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFile, TranslationBase.of(context).My_File_Details, "assets/images/new/medical file.svg", isLogin)); - hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointment, "assets/images/new/book appointment.svg", isLogin)); - hmgServices.add(new HmgServices(11, TranslationBase.of(context).online, TranslationBase.of(context).pharmacy, "assets/images/new/Pharmacy.svg", isLogin)); + hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); + hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); - hmgServices.add(new HmgServices(13, TranslationBase.of(context).myFamily, TranslationBase.of(context).Family_Files, "assets/images/new/my family.svg", isLogin)); + hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin)); - hmgServices.add(new HmgServices(17, TranslationBase.of(context).Health, TranslationBase.of(context).Calculator, "assets/images/new/health calculator.svg", isLogin)); - hmgServices.add(new HmgServices(18, TranslationBase.of(context).Health, TranslationBase.of(context).Converter, "assets/images/new/health converter.svg", isLogin)); - hmgServices.add(new HmgServices(19, TranslationBase.of(context).Smart, TranslationBase.of(context).Watches, "assets/images/new/smart watch.svg", isLogin)); - hmgServices.add(new HmgServices(20, TranslationBase.of(context).Parking, TranslationBase.of(context).Details, "assets/images/new/parking details.svg", isLogin)); + hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); + hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); + hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin)); + hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin)); hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); - hmgServices.add(new HmgServices(22, TranslationBase.of(context).News, TranslationBase.of(context).Latest, "assets/images/new/latest news.svg", isLogin)); + hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); } @override @@ -90,7 +90,7 @@ class _AllHabibMedicalSevicePage2State extends State child: Column( children: [ AspectRatio( - aspectRatio: 1.8, + aspectRatio: 1.9, child: Container( width: double.infinity, height: double.infinity, @@ -106,7 +106,7 @@ class _AllHabibMedicalSevicePage2State extends State ? Color(0xFFFECB50) : Color(0xFF122F48)), child: Padding( - padding: const EdgeInsets.all(30.0), + padding: const EdgeInsets.all(20.0), child: Stack( alignment: projectViewModel.isArabic ? Alignment.centerLeft : Alignment.centerRight, children: [ @@ -118,7 +118,7 @@ class _AllHabibMedicalSevicePage2State extends State child: Text( weather, style: TextStyle( - fontSize: 30, + fontSize: 24, letterSpacing: -0.83, fontWeight: FontWeight.bold, color: Colors.white, @@ -134,11 +134,11 @@ class _AllHabibMedicalSevicePage2State extends State color: Colors.white, ), ), - mFlex(1), + mFlex(0), Text( TranslationBase.of(context).healthWeatherIndicators, style: TextStyle( - fontSize: 16, + fontSize: 12, letterSpacing: -0.96, fontWeight: FontWeight.bold, color: Colors.white, @@ -147,7 +147,7 @@ class _AllHabibMedicalSevicePage2State extends State Text( TranslationBase.of(context).healthTipsBasedOnCurrentWeather, style: TextStyle( - fontSize: 12, + fontSize: 10, letterSpacing: -0.72, fontWeight: FontWeight.w600, color: Colors.white, @@ -163,7 +163,7 @@ class _AllHabibMedicalSevicePage2State extends State ); }, child: Padding( - padding: const EdgeInsets.only(top: 8, bottom: 8), + padding: const EdgeInsets.only(top: 0, bottom: 0), child: Text( TranslationBase.of(context).moreDetails, style: TextStyle(fontSize: 12, letterSpacing: -0.72, fontWeight: FontWeight.w600, color: Colors.white, decoration: TextDecoration.underline), diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart index b38e3f63..39264fe8 100644 --- a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart +++ b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart @@ -50,7 +50,7 @@ class _HospitalsPageState extends State { ? SingleChildScrollView( child: Column(children: [ AspectRatio( - aspectRatio: 1.8, + aspectRatio: 2.3, child: Container( width: double.infinity, height: double.infinity, @@ -66,7 +66,7 @@ class _HospitalsPageState extends State { ? Color(0xFFFECB50) : Color(0xFF122F48)), child: Padding( - padding: const EdgeInsets.all(30.0), + padding: const EdgeInsets.all(20.0), child: Stack( alignment: projectViewModel.isArabic ? Alignment.centerLeft : Alignment.centerRight, children: [ @@ -78,7 +78,7 @@ class _HospitalsPageState extends State { child: Text( weather, style: TextStyle( - fontSize: 30, + fontSize: 24, letterSpacing: -0.83, fontWeight: FontWeight.bold, color: Colors.white, @@ -94,11 +94,11 @@ class _HospitalsPageState extends State { color: Colors.white, ), ), - mFlex(1), + mFlex(0), Text( TranslationBase.of(context).healthWeatherIndicators, style: TextStyle( - fontSize: 16, + fontSize: 12, letterSpacing: -0.96, fontWeight: FontWeight.bold, color: Colors.white, @@ -107,7 +107,7 @@ class _HospitalsPageState extends State { Text( TranslationBase.of(context).healthTipsBasedOnCurrentWeather, style: TextStyle( - fontSize: 12, + fontSize: 10, letterSpacing: -0.72, fontWeight: FontWeight.w600, color: Colors.white, diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 7b699467..6ae318c3 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -56,7 +56,26 @@ class NotificationsPage extends StatelessWidget { GifLoaderDialogUtils.hideDialog(context); }, child: Center( - child: Image.asset('assets/images/notf.png'), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Image.asset('assets/images/notf.png'), + Icon( + Icons.notifications_active, + color: CustomColors.accentColor, + size: 40, + ), + Padding( + padding: const EdgeInsets.only(left: 10.0, right: 10.0), + child: Text(TranslationBase.of(context).moreNotifications, style: TextStyle( + color: CustomColors.accentColor, + fontWeight: FontWeight.w600, + letterSpacing: -0.64, + decoration: TextDecoration.underline + )), + ), + ], + ), ), ); } @@ -154,91 +173,6 @@ class NotificationsPage extends StatelessWidget { ); }, itemCount: model.notifications.length + 1)), - // ListView( - // children: model.notifications - // .map( - // (notification) => InkWell( - // onTap: () async { - // if (!notification.isRead) { - // model.markAsRead(notification.id); - // } - // Navigator.push( - // context, - // FadePage( - // page: NotificationsDetailsPage( - // notification: notification, - // ))); - // }, - // child: Container( - // width: double.infinity, - // padding: EdgeInsets.all(8.0), - // decoration: BoxDecoration( - // color: notification.isRead ? CustomColors.white : CustomColors.accentColor.withOpacity(0.05), - // border: Border( - // left: BorderSide( - // color: notification.isRead ? Colors.grey[200] : CustomColors.accentColor, - // width: 5.0, - // ), - // ), - // ), - // child: Row( - // children: [ - // Expanded( - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), - // SizedBox( - // height: 5, - // ), - // Row( - // children: [ - // Expanded( - // child: Texts(notification.message)), - // if (notification.messageType == "image") - // Icon(FontAwesomeIcons.images, color: CustomColors.grey,) - // ], - // ), - // SizedBox( - // height: 5, - // ), - // Divider( - // height: 5.0, - // color: CustomColors.grey2, - // ), - // ], - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // ) - // .toList() - // ..add( - // InkWell( - // onTap: () async { - // GifLoaderDialogUtils.showMyDialog(context); - // currentIndex++; - // GetNotificationsRequestModel - // getNotificationsRequestModel = - // new GetNotificationsRequestModel( - // currentPage: currentIndex, - // pagingSize: 14, - // notificationStatusID: 2); - // - // await model.getNotifications( - // getNotificationsRequestModel, context); - // GifLoaderDialogUtils.hideDialog(context); - // }, - // child: Center( - // child: Image.asset('assets/images/notf.png'), - // ), - // ), - // )), ); } } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 08a7971e..21a82f6a 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -53,14 +53,14 @@ class _HomePageFragment2State extends State { initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCareTitle, TranslationBase.of(context).liveCareSubtitle, "assets/images/new/Live_Care.svg", isLogin)); hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/covid_test_drive_thru.svg", isLogin)); hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); hmgServices.add(new HmgServices(8, TranslationBase.of(context).findUs, TranslationBase.of(context).reachUs, "assets/images/new/reach_us.svg", isLogin)); } @@ -496,7 +496,7 @@ class _HomePageFragment2State extends State { Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4), + padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.3), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, @@ -515,7 +515,7 @@ class _HomePageFragment2State extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - TranslationBase.of(context).onlinePharmacy, + TranslationBase.of(context).pharmacyTitle, style: TextStyle( color: Colors.black, fontSize: 14, @@ -526,7 +526,7 @@ class _HomePageFragment2State extends State { ), projectViewModel.isArabic ? mHeight(5) : Container(), Text( - TranslationBase.of(context).ecommerceSolution, + TranslationBase.of(context).pharmacySubtitle, style: TextStyle( color: Colors.black, fontSize: 9, diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart index 2245872b..9f395cad 100644 --- a/lib/pages/landing/home_page_2.dart +++ b/lib/pages/landing/home_page_2.dart @@ -66,7 +66,7 @@ class _HomePageState2 extends State { } else { GifLoaderDialogUtils.showMyDialog(context); await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if (pharmacyModuleViewModel.error.isNotEmpty) { + if (!pharmacyModuleViewModel.error.isNotEmpty) { await pharmacyModuleViewModel.createUser().then((value) { GifLoaderDialogUtils.hideDialog(context); Navigator.push(context, FadePage(page: LandingPagePharmacy())); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 2bb0e1d0..628886db 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -279,7 +279,7 @@ class _Login extends State { ConfirmDialog.closeAlertDialog(context), Navigator.of(context).push(FadePage(page: Register())), }, - cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); + cancelFunction: () => {}); dialog.showAlertDialog(context); }); // SMSOTP.showLoadingDialog(context, false), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 76c09e00..d8201c65 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1761,7 +1761,9 @@ class TranslationBase { String get referralNumber => localizedValues['referralNumber'][locale.languageCode]; String get needPrescription => localizedValues['needPrescription'][locale.languageCode]; + String get outOfStockMsg => localizedValues['outOfStockMsg'][locale.languageCode]; + String get requestID => localizedValues['requestID'][locale.languageCode]; String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode]; @@ -1799,10 +1801,11 @@ class TranslationBase { String get quantitySize => localizedValues['quantitySize'][locale.languageCode]; String get addToCart => localizedValues['addToCart'][locale.languageCode]; - String get addToWishlist => - localizedValues['addToWishlist'][locale.languageCode]; - String get removeFromWishlist => - localizedValues['removeFromWishlist'][locale.languageCode]; + + String get addToWishlist => localizedValues['addToWishlist'][locale.languageCode]; + + String get removeFromWishlist => localizedValues['removeFromWishlist'][locale.languageCode]; + String get buyNow => localizedValues['buyNow'][locale.languageCode]; String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode]; @@ -2475,11 +2478,46 @@ class TranslationBase { String get Latest => localizedValues["Latest"][locale.languageCode]; String get Tour => localizedValues["Tour"][locale.languageCode]; + String get mostViewed => localizedValues["mostViewed"][locale.languageCode]; + String get newProducts => localizedValues["newProducts"][locale.languageCode]; String get paymentSelected => localizedValues["paymentSelected"][locale.languageCode]; + String get moreNotifications => localizedValues["moreNotifications"][locale.languageCode]; + + String get familyTitle => localizedValues["familyTitle"][locale.languageCode]; + + String get familySubtitle => localizedValues["familySubtitle"][locale.languageCode]; + + String get liveCareTitle => localizedValues["liveCareTitle"][locale.languageCode]; + + String get liveCareSubtitle => localizedValues["liveCareSubtitle"][locale.languageCode]; + + String get pharmacyTitle => localizedValues["pharmacyTitle"][locale.languageCode]; + + String get pharmacySubtitle => localizedValues["pharmacySubtitle"][locale.languageCode]; + + String get parkingTitle2 => localizedValues["parkingTitle2"][locale.languageCode]; + + String get parkingSubtitle => localizedValues["ParkingSubtitle"][locale.languageCode]; + + String get healthCalculatorTitle => localizedValues["healthCalculatorTitle"][locale.languageCode]; + + String get healthCalculatorSubtitle => localizedValues["healthCalculatorSubtitle"][locale.languageCode]; + + String get waterTitle => localizedValues["waterTitle"][locale.languageCode]; + + String get waterSubtitle => localizedValues["waterSubtitle"][locale.languageCode]; + + String get medicalFileTitle2 => localizedValues["medicalFileTitle2"][locale.languageCode]; + + String get medicalFileSubtitle => localizedValues["medicalFileSubtitle"][locale.languageCode]; + + String get healthConvertersTitle => localizedValues["healthConvertersTitle"][locale.languageCode]; + + String get healthConvertersSubtitle => localizedValues["healthConvertersSubtitle"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart index 7bbadd8c..f0016fc5 100644 --- a/lib/widgets/bottom_options/BottomSheet.dart +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -23,7 +23,7 @@ class ImageOptions { icon: FeatherIcons.image, onTap: () async { File _image = - await ImagePicker.pickImage(source: ImageSource.gallery); + await ImagePicker.pickImage(source: ImageSource.gallery, imageQuality: 50); String fileName = _image.path; final bytes = File(fileName).readAsBytesSync(); String base64Encode = base64.encode(bytes); @@ -37,7 +37,7 @@ class ImageOptions { icon: FeatherIcons.camera, onTap: () async { File _image = - await ImagePicker.pickImage(source: ImageSource.camera); + await ImagePicker.pickImage(source: ImageSource.camera, imageQuality: 50); String fileName = _image.path; final bytes = File(fileName).readAsBytesSync(); String base64Encode = base64.encode(bytes); From 2032053cb755e2791c35ed1f1f3417525bf6157d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 21 Oct 2021 17:50:37 +0300 Subject: [PATCH 4/5] Working on Health data --- lib/config/localized_values.dart | 3 + lib/core/service/client/base_app_client.dart | 2 +- .../SmartWatch/WeeklyStepsResModel.dart | 42 ++ .../SmartWatch/YearlyStepsResModel.dart | 3 +- .../Steps/stepsTracker.dart | 426 ++++++++++++++++++ .../health_data_list.dart | 291 +++++------- .../smart_watch_instructions.dart | 21 +- .../smart_watch_health_data/stepsTracker.dart | 249 ---------- lib/uitl/translations_delegate_base.dart | 6 + 9 files changed, 612 insertions(+), 431 deletions(-) create mode 100644 lib/models/SmartWatch/WeeklyStepsResModel.dart create mode 100644 lib/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart delete mode 100644 lib/pages/medical/smart_watch_health_data/stepsTracker.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b4c0df07..7c13c84a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1578,4 +1578,7 @@ const Map localizedValues = { "medicalFileSubtitle": {"en": "Details", "ar": "ملفي الطبي"}, "healthConvertersTitle": {"en": "Health", "ar": "تحويل"}, "healthConvertersSubtitle": {"en": "Converters", "ar": "القياسات"}, + "syncHealthData": { "en": "Sync Health Data", "ar": "مزامنة البيانات الصحية" }, + "steps": { "en": "Steps", "ar": "الخطوات" }, + "avgSteps": { "en": "Average Steps", "ar": "متوسط الخطوات" }, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 0dd5c750..dc8f5288 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -115,7 +115,7 @@ class BaseAppClient { } // body['PatientID'] = 1018977; - // body['TokenID'] = "@dm!n"; + body['TokenID'] = "@dm!n"; print("URL : $url"); final jsonBody = json.encode(body); diff --git a/lib/models/SmartWatch/WeeklyStepsResModel.dart b/lib/models/SmartWatch/WeeklyStepsResModel.dart new file mode 100644 index 00000000..9c1f2da5 --- /dev/null +++ b/lib/models/SmartWatch/WeeklyStepsResModel.dart @@ -0,0 +1,42 @@ +class WeeklyStepsResModel { + int iD; + int patientID; + int medCategoryID; + int medSubCategoryID; + num value; + String machineDate; + bool patientOutSA; + dynamic notes; + bool isActive; + String createdOn; + + WeeklyStepsResModel({this.iD, this.patientID, this.medCategoryID, this.medSubCategoryID, this.value, this.machineDate, this.patientOutSA, this.notes, this.isActive, this.createdOn}); + + WeeklyStepsResModel.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + medCategoryID = json['MedCategoryID']; + medSubCategoryID = json['MedSubCategoryID']; + value = num.tryParse(json['Value']).toInt(); + machineDate = json['MachineDate']; + patientOutSA = json['PatientOutSA']; + notes = json['Notes']; + isActive = json['IsActive']; + createdOn = json['CreatedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['MedCategoryID'] = this.medCategoryID; + data['MedSubCategoryID'] = this.medSubCategoryID; + data['Value'] = this.value; + data['MachineDate'] = this.machineDate; + data['PatientOutSA'] = this.patientOutSA; + data['Notes'] = this.notes; + data['IsActive'] = this.isActive; + data['CreatedOn'] = this.createdOn; + return data; + } +} diff --git a/lib/models/SmartWatch/YearlyStepsResModel.dart b/lib/models/SmartWatch/YearlyStepsResModel.dart index 728633d9..c98fff27 100644 --- a/lib/models/SmartWatch/YearlyStepsResModel.dart +++ b/lib/models/SmartWatch/YearlyStepsResModel.dart @@ -1,5 +1,5 @@ class YearlyStepsResModel { - double valueSum; + num valueSum; int medCategoryID; int month; String monthName; @@ -21,6 +21,7 @@ class YearlyStepsResModel { monthName = json['MonthName']; patientID = json['PatientID']; year = json['Year']; + valueSum = valueSum != null ? valueSum.toInt() : valueSum; } Map toJson() { diff --git a/lib/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart new file mode 100644 index 00000000..f879886a --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart @@ -0,0 +1,426 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/SmartWatch/WeeklyStepsResModel.dart'; +import 'package:diplomaticquarterapp/models/SmartWatch/YearlyStepsResModel.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class StepsTracker extends StatefulWidget { + @override + _StepsTrackerState createState() => _StepsTrackerState(); +} + +class _StepsTrackerState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + + ProjectViewModel projectViewModel; + + int weeklyStatsAvgValue = 0; + int monthlyStatsAvgValue = 0; + int yearlyStatsAvgValue = 0; + + int avgWeeklyStepsValue = 0; + int weeklyDataLength = 0; + + int avgMonthlyStepsValue = 0; + int monthlyDataLength = 0; + + int avgYearlyStepsValue = 0; + int yearlyDataLength = 0; + + List weekyStepsList = List(); + List yearlyStepsList = List(); + + List weeklyTimeSeriesData = []; + List monthlyTimeSeriesData = []; + List yearlyTimeSeriesData = []; + + bool isWeeklyDataLoaded = false; + bool isMonthlyDataLoaded = false; + bool isYearlyDataLoaded = false; + + @override + void initState() { + _tabController = new TabController(length: 3, vsync: this); + WidgetsBinding.instance.addPostFrameCallback((_) { + // getYearlyStepsData(); + getWeeklyStepsData(); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).steps, + showNewAppBar: true, + showNewAppBarTitle: true, + isShowDecPage: false, + body: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [ + Tab(text: TranslationBase.of(context).weekly), + Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).yearly), + ], + onTap: (value) { + if (value == 0) { + getWeeklyStepsData(); + } else if (value == 1) { + } else { + getYearlyStepsData(); + } + }, + ), + Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + isWeeklyDataLoaded ? getWeeklyStepsDetails() : Container(), + isMonthlyDataLoaded ? getMonthlyStepsDetails() : Container(), + isYearlyDataLoaded ? getYearlyStepsDetails() : Container() + ], + controller: _tabController, + ), + ), + ], + ), + ); + } + + getWeeklyStepsData() { + avgWeeklyStepsValue = 0; + weeklyDataLength = 0; + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getPatientHealthDataStats(6, 1, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['Med_GetYearStepsTransactionsStsList']); + weekyStepsList.clear(); + res['Med_GetWeekStepsTransactionsStsList'].forEach((element) { + weekyStepsList.add(new WeeklyStepsResModel.fromJson(element)); + if (element['Value'] != null) { + num value = num.tryParse(element['Value'] ?? "0"); + avgWeeklyStepsValue += value.toInt(); + weeklyDataLength++; + } + }); + generateWeekData(); + setState(() { + weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength; + isWeeklyDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + getMonthlyStepsData() {} + + getYearlyStepsData() { + avgYearlyStepsValue = 0; + yearlyDataLength = 0; + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getPatientHealthDataStats(6, 3, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['Med_GetYearStepsTransactionsStsList']); + yearlyStepsList.clear(); + res['Med_GetYearStepsTransactionsStsList'].forEach((element) { + yearlyStepsList.add(new YearlyStepsResModel.fromJson(element)); + if (element['ValueSum'] != null) { + num value = element['ValueSum']; + avgYearlyStepsValue += value.toInt(); + yearlyDataLength++; + } + }); + generateYearData(); + setState(() { + yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength; + isYearlyDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + generateWeekData() { + if (weekyStepsList.length > 0) { + weeklyTimeSeriesData.clear(); + weekyStepsList.forEach( + (element) { + weeklyTimeSeriesData.add( + TimeSeriesSales2( + DateUtil.convertStringToDate(element.machineDate), + element.value != null ? element.value : 0.0, + ), + ); + }, + ); + } + } + + generateYearData() { + if (yearlyStepsList.length > 0) { + yearlyTimeSeriesData.clear(); + yearlyStepsList.forEach( + (element) { + yearlyTimeSeriesData.add( + TimeSeriesSales2( + new DateTime(element.year, element.month, 1), + element.valueSum != null ? double.tryParse(element.valueSum.toString()) : 0.0, + ), + ); + }, + ); + } + } + + getWeeklyStepsDetails() { + return SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: ShowChart( + title: "", + timeSeries: weeklyTimeSeriesData, + indexes: weeklyTimeSeriesData.length ~/ 5.5, + horizontalInterval: 8, + ), + ), + Container( + child: Container( + decoration: cardRadius(12), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 5.0), + child: Text(TranslationBase.of(context).avgSteps, style: TextStyle(fontSize: 18.0)), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Text(weeklyStatsAvgValue.toString() + " " + TranslationBase.of(context).steps, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + ), + ), + Container( + decoration: cardRadius(12), + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text(TranslationBase.of(context).details, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + )), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + weekyStepsList.isEmpty + ? Container( + child: Center( + child: Text(TranslationBase.of(context).noDataAvailable), + ), + ) + : Table( + columnWidths: { + 0: FlexColumnWidth(2.5), + }, + children: fullDataWeekly(context), + ), + ], + ), + ) + ], + ), + ), + ], + ), + ); + } + + getMonthlyStepsDetails() { + return Container( + child: Text("Monthly"), + ); + } + + getYearlyStepsDetails() { + return SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: ShowChart( + title: "", + timeSeries: yearlyTimeSeriesData, + indexes: yearlyTimeSeriesData.length ~/ 5.5, + horizontalInterval: 8, + ), + ), + Container( + child: Container( + decoration: cardRadius(12), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 5.0), + child: Text(TranslationBase.of(context).avgSteps, style: TextStyle(fontSize: 18.0)), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Text(yearlyStatsAvgValue.toString() + " " + TranslationBase.of(context).steps, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + ), + ), + Container( + decoration: cardRadius(12), + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text(TranslationBase.of(context).details, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + )), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + yearlyStepsList.isEmpty + ? Container( + child: Center( + child: Text(TranslationBase.of(context).noDataAvailable), + ), + ) + : Table( + columnWidths: { + 0: FlexColumnWidth(2.5), + }, + children: fullData(context), + ), + ], + ), + ) + ], + ), + ), + ], + ), + ); + } + + List fullData(BuildContext context) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Utils.tableColumnTitle(TranslationBase.of(context).date), + Utils.tableColumnTitle(TranslationBase.of(context).steps), + ], + ), + ); + yearlyStepsList.forEach( + (step) { + tableRow.add( + TableRow( + children: [ + Utils.tableColumnValue( + '${DateUtil.getDayMonthYearDateFormatted( + new DateTime(step.year, step.month, 1), + )} ', + isCapitable: false, + mProjectViewModel: projectViewModel), + Utils.tableColumnValue(step.valueSum.toString(), isCapitable: false, mProjectViewModel: projectViewModel), + ], + ), + ); + }, + ); + return tableRow; + } + + List fullDataWeekly(BuildContext context) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Utils.tableColumnTitle(TranslationBase.of(context).date), + Utils.tableColumnTitle(TranslationBase.of(context).steps), + ], + ), + ); + weekyStepsList.forEach( + (step) { + tableRow.add( + TableRow( + children: [ + Utils.tableColumnValue( + '${DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(step.machineDate), + )} ', + isCapitable: false, + mProjectViewModel: projectViewModel), + Utils.tableColumnValue(step.value.toString(), isCapitable: false, mProjectViewModel: projectViewModel), + ], + ), + ); + }, + ); + return tableRow; + } +} diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart index cbfc1c5c..12dd7ee1 100644 --- a/lib/pages/medical/smart_watch_health_data/health_data_list.dart +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -1,6 +1,9 @@ -import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/stepsTracker.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/Steps/stepsTracker.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; + // import 'package:fit_kit/fit_kit.dart'; import 'package:flutter/material.dart'; @@ -10,7 +13,6 @@ class HealthDataList extends StatefulWidget { } class _HealthDataListState extends State { - // List dataTypes = List(); @override @@ -27,191 +29,134 @@ class _HealthDataListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Smartwatches", - isShowAppBar: true, - body: Container( - height: MediaQuery - .of(context) - .size - .height, - margin: EdgeInsets.all(20.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - child: Image.asset( - "assets/images/SmartWatches/heartrate_icon.png", - width: 60.0, - height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Heart Rate", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], - ), - Divider( - color: Colors.grey[500], - ), - Row( - children: [ - Container( - child: Image.asset( - "assets/images/SmartWatches/sleep_data.png", - width: 60.0, - height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Sleep Data", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], - ), - Divider( - color: Colors.grey[500], - ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: StepsTracker(), - ), - ); - }, - child: Row( - children: [ - Container( - child: Image.asset( - "assets/images/SmartWatches/heartrate_icon.png", - width: 60.0, - height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Steps", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], + appBarTitle: TranslationBase.of(context).smartWatches, + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + body: Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.all(20.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), ), - ), - Divider( - color: Colors.grey[500], - ), - Row( - children: [ - Container( - child: Image.asset( - "assets/images/SmartWatches/heartrate_icon.png", - width: 60.0, - height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Distance", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Heart Rate", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset("assets/images/SmartWatches/sleep_data.png", width: 60.0, height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Sleep Data", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: StepsTracker(), ), - ], - ), - Divider( - color: Colors.grey[500], - ), - Row( + ); + }, + child: Row( children: [ Container( - child: Image.asset( - "assets/images/SmartWatches/heartrate_icon.png", - width: 60.0, - height: 60.0), + child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), ), Container( margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Energy", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), + child: Text("Steps", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), ), ], ), - Divider( - color: Colors.grey[500], - ), - ], - ), - ), - ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery - .of(context) - .size - .height * 0.1, - color: Colors.grey[100], - child: Column( - children: [ + ), Divider( - color: Colors.transparent, + color: Colors.grey[500], ), - InkWell( - onTap: () { - print("ReadLast"); - // readLast(); - }, - child:Container( - height: (MediaQuery - .of(context) - .size - .height/2)*0.12, - width: MediaQuery - .of(context) - .size - .width * 0.8, - decoration: BoxDecoration( - color: Colors.grey[800], - borderRadius: BorderRadius.circular(6.0), + Row( + children: [ + Container( + child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), ), - child: Container( - padding: EdgeInsets.only(top: 10.0), - child: Text( - 'Sync Health Data' , textAlign: TextAlign.center,style: TextStyle( - color: Colors.white , fontSize: 18.0 - ), - ), - ),),), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Distance", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), + Row( + children: [ + Container( + child: Image.asset("assets/images/SmartWatches/heartrate_icon.png", width: 60.0, height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Energy", style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + Divider( + color: Colors.grey[500], + ), ], ), - )); + ), + ), + bottomSheet: Container( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(20.0), + child: DefaultButton(TranslationBase.of(context).syncHealthData, () { + print("ReadLast"); + // readLast(); + }), + ), + ), + ); } - - // void readLast() async { - // print("ReadLast"); - // final result = await FitKit.readLast(DataType.DISTANCE); - // print(result); - // print(result); - // } - // - // void readAll() async { - // if (await FitKit.requestPermissions(dataTypes)) { - // for (DataType type in dataTypes) { - // final results = await FitKit.read( - // type, - // dateFrom: DateTime.now().subtract(Duration(days: 7)), - // dateTo: DateTime.now(), - // limit: 100, - // ); - // print(results); - // print(results.length); - // } - // readLast(); - // } - // } -} \ No newline at end of file +// void readLast() async { +// print("ReadLast"); +// final result = await FitKit.readLast(DataType.DISTANCE); +// print(result); +// print(result); +// } +// +// void readAll() async { +// if (await FitKit.requestPermissions(dataTypes)) { +// for (DataType type in dataTypes) { +// final results = await FitKit.read( +// type, +// dateFrom: DateTime.now().subtract(Duration(days: 7)), +// dateTo: DateTime.now(), +// limit: 100, +// ); +// print(results); +// print(results.length); +// } +// readLast(); +// } +// } +} diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index eb8e916e..c550fa08 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchI 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/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -37,9 +38,11 @@ class _SmartWatchInstructionsState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Sync Health Data", + appBarTitle: TranslationBase.of(context).smartWatches, isShowAppBar: true, isShowDecPage: true, + showNewAppBar: true, + showNewAppBarTitle: true, description: TranslationBase.of(context).infoHealthData, imagesInfo: [ ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/0.png'), @@ -56,9 +59,10 @@ class _SmartWatchInstructionsState extends State { return SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, children: [ - Container( - margin: EdgeInsets.only(top: 10.0), + Flexible( + // margin: EdgeInsets.only(top: 10.0), child: CarouselSlider( carouselController: buttonCarouselController, options: CarouselOptions( @@ -85,8 +89,7 @@ class _SmartWatchInstructionsState extends State { child: Text("Supported Smartwatches", style: TextStyle( fontSize: 22.0, - fontWeight: FontWeight.bold, - fontFamily: "WorkSans")), + fontWeight: FontWeight.bold)), ), Container( child: Row( @@ -371,7 +374,7 @@ class _SmartWatchInstructionsState extends State { ), Container( margin: EdgeInsets.fromLTRB( - 15.0, 110.0, 15.0, 15.0), + 15.0, 80.0, 15.0, 15.0), child: ButtonTheme( shape: RoundedRectangleBorder( borderRadius: @@ -854,6 +857,10 @@ class _SmartWatchInstructionsState extends State { _openHealthDataList() { Navigator.push( - context, MaterialPageRoute(builder: (context) => HealthDataList())); + context, + FadePage( + page: HealthDataList(), + ), + ); } } diff --git a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart deleted file mode 100644 index 3fe1a4ba..00000000 --- a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart +++ /dev/null @@ -1,249 +0,0 @@ -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:diplomaticquarterapp/models/SmartWatch/YearlyStepsResModel.dart'; -import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class StepsTracker extends StatefulWidget { - @override - _StepsTrackerState createState() => _StepsTrackerState(); -} - -class _StepsTrackerState extends State - with SingleTickerProviderStateMixin { - TabController _tabController; - - int weeklyStatsAvgValue = 0; - int monthlyStatsAvgValue = 0; - int yearlyStatsAvgValue = 0; - - int avgStepsValue = 0; - int dataLength = 0; - - List yearlyStepsList = List(); - - List yearlyTimeSeriesData = []; - - bool isDataLoaded = false; - - @override - void initState() { - _tabController = new TabController(length: 3, vsync: this); - WidgetsBinding.instance.addPostFrameCallback((_) { - getYearlyStepsData(); - }); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: "Steps", - isShowDecPage: false, - body: Container( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - TabBar( - tabs: [ - Tab(text: TranslationBase.of(context).weekly), - Tab(text: TranslationBase.of(context).monthly), - Tab(text: TranslationBase.of(context).yearly), - ], - controller: _tabController, - ), - Expanded( - child: new TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - isDataLoaded ? getWeeklyStepsDetails() : Container(), - isDataLoaded ? getMonthlyStepsDetails() : Container(), - isDataLoaded ? getYearlyStepsDetails() : Container() - ], - controller: _tabController, - ), - ), - ], - ), - ), - ); - } - - getYearlyStepsData() { - avgStepsValue = 0; - dataLength = 0; - - DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(context); - service.getPatientHealthDataStats(6, 3, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - print(res['Med_GetYearStepsTransactionsStsList']); - yearlyStepsList.clear(); - res['Med_GetYearStepsTransactionsStsList'].forEach((element) { - print('in forEach'); - yearlyStepsList.add(new YearlyStepsResModel.fromJson(element)); - if (element['ValueSum'] != null) { - double value = element['ValueSum']; - avgStepsValue += value.toInt(); - dataLength++; - } - }); - print("innnnnnnnnnnnnnnnn"); - print(avgStepsValue); - print(dataLength); - setState(() { - yearlyStatsAvgValue = avgStepsValue ~/ dataLength; - isDataLoaded = true; - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - // AppToast.showErrorToast(message: err); - print(err); - }); - } - - generateData() { - if (yearlyStepsList.length > 0) { - yearlyTimeSeriesData.clear(); - yearlyStepsList.forEach( - (element) { - yearlyTimeSeriesData.add( - TimeSeriesSales( - new DateTime(element.year, element.month, 1), - element.valueSum != null ? element.valueSum.toInt() : 0, - ), - ); - }, - ); - yearlyTimeSeriesData.forEach((element) { - print(element.sales); - print(element.time); - }); - } - return [ - new charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (TimeSeriesSales sales, _) => sales.time, - measureFn: (TimeSeriesSales sales, _) => sales.sales, - data: yearlyTimeSeriesData, - ) - ]; - } - - getWeeklyStepsDetails() { - return Container( - child: Text("Weekly"), - ); - } - - getMonthlyStepsDetails() { - return Container( - child: Text("Monthly"), - ); - } - - getYearlyStepsDetails() { - return Container( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - child: AppTimeSeriesChart( - seriesList: generateData(), - chartName: "Steps", - startDate: DateTime( - yearlyStepsList[0].year, yearlyStepsList[0].month, 1), - endDate: DateTime( - yearlyStepsList[yearlyStepsList.length - 1].year, - yearlyStepsList[yearlyStepsList.length - 1].month, - 1), - ), - ), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: BorderSide(color: Colors.grey[400], width: 0.6)), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0), - child: - Text("Average Steps", style: TextStyle(fontSize: 18.0)), - ), - Container( - margin: EdgeInsets.only(bottom: 10.0), - child: Text(yearlyStatsAvgValue.toString() + " Steps", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], - ), - ), - ), - Container( - margin: EdgeInsets.all(10.0), - child: Divider( - color: Colors.grey[500], - ), - ), - Container( - transform: Matrix4.translationValues(0.0, -10.0, 0.0), - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text("History", style: TextStyle(fontSize: 14.0)), - Row( - children: [ - Text("view more", style: TextStyle(fontSize: 14.0)), - Container( - margin: EdgeInsets.only(left: 3.0, right: 3.0), - transform: Matrix4.translationValues(0.0, 1.5, 0.0), - width: 30.0, - height: 30.0, - child: Image.asset( - "assets/images/new-design/view_more.png", - fit: BoxFit.contain), - ), - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), - child: Card( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: BorderSide(color: Colors.grey[400], width: 0.6)), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0), - child: Text("Date", - style: TextStyle( - fontSize: 18.0, fontWeight: FontWeight.bold)), - ), - Container( - padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0), - child: Text("Steps", style: TextStyle(fontSize: 18.0)), - ), - ], - ), - ), - ), - ], - ), - ); - } -} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d8201c65..aaf92cc7 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2518,6 +2518,12 @@ class TranslationBase { String get healthConvertersTitle => localizedValues["healthConvertersTitle"][locale.languageCode]; String get healthConvertersSubtitle => localizedValues["healthConvertersSubtitle"][locale.languageCode]; + + String get syncHealthData => localizedValues["syncHealthData"][locale.languageCode]; + + String get steps => localizedValues["steps"][locale.languageCode]; + + String get avgSteps => localizedValues["avgSteps"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 745b167c47151e234e3a3a22e1b963ffcc95ecb7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 21 Oct 2021 18:05:59 +0300 Subject: [PATCH 5/5] register --- lib/pages/login/register.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index f7def7c8..b93e4e55 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -150,7 +150,9 @@ class _Register extends State { )), bottomSheet: Container( width: double.maxFinite, - height: 80.0, + // height: 80.0, + color: Colors.white, + margin: EdgeInsets.only(bottom: 50.0), child: Row( children: [ Expanded(