From ebc5ba7743c2d59cd40c67190e158ddab5b8a3e0 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 27 Jan 2021 10:33:30 +0200 Subject: [PATCH 1/3] some fixes --- lib/config/localized_values.dart | 3 + .../patient-doctor-referral-service.dart | 5 +- .../viewModel/patient-referral-viewmodel.dart | 4 +- .../profile/UCAF/UCAF-detail-screen.dart | 19 +- .../profile/UCAF/UCAF-input-screen.dart | 43 ++-- .../referral/refer-patient-screen.dart | 55 +++-- .../vital_sign/vital_sign_details_screen.dart | 190 ++++++++++-------- lib/util/translations_delegate_base.dart | 13 ++ .../shared/dialogs/dailog-list-select.dart | 2 +- 9 files changed, 209 insertions(+), 125 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2de1f3d1..f70e13c8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -674,4 +674,7 @@ const Map> localizedValues = { 'en': "Referral Remark : ", 'ar': "ملاحظة الإحالة :" }, + 'icd': {'en': "ICD", 'ar': "التصنيف الدولي للأمراض" + // 'icd': {'en': "ICD", 'ar': " " + }, }; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 2f18540a..f452cfb6 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -32,13 +32,14 @@ class PatientReferralService extends LookupService { "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", - "IsLoginForDoctorApp": true + "IsLoginForDoctorApp": true, + // "MemberID": memberID }; dynamic localRes; await baseAppClient.post(url, onSuccess: (response, statusCode) async { if (response['MessageStatus'] == 1) { - projectsList = response['ListProject']; + projectsList = response['ProjectInfo']; } else { // handel error projectsList = ListProject; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index abe39224..b9987601 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -94,8 +94,8 @@ class PatientReferralViewModel extends BaseViewModel { DoctorProfileModel doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { dynamic _selectedBranch = { - "ID": doctorProfile.projectID, - "Desciption": doctorProfile.projectName + "facilityId": doctorProfile.projectID, + "facilityName": doctorProfile.projectName }; return _selectedBranch; } diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 489c462d..0831fffe 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -284,7 +284,24 @@ class DiagnosisWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "${diagnosis.icdCode10ID} ${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", + "${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).icd}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "${diagnosis.icdCode10ID}}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 0116ce46..1a9ac4fa 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -144,24 +144,31 @@ class _UCAFInputScreenState extends State { ), ], ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.temperatureCelcius}(C), ${model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32}(F)", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + SizedBox( + width: 4, + ), + Expanded( + child: Row( + children: [ + AppText( + "${TranslationBase.of(context).temperature}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), ], ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 2c5311cc..04eba96e 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -74,14 +75,14 @@ class _PatientMakeReferralScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - if (model.state == ViewState.BusyLocal) + /*if (model.state == ViewState.BusyLocal) Container( color: Colors.white, width: 50, height: 50, child: AppLoaderWidget( containerColor: Colors.white, - )), + )),*/ Column( children: [ PatientPageHeaderWidget(patient), @@ -95,17 +96,16 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? ReferralForm(model, screenSize) : PatientReferralItemWidget( - patientName: model.patientReferral[0].patientName, - referralStatus: "${model.patientReferral[0].referralStatus}", - isReferredTo: true, - isSameBranch: model.patientReferral[0] - .isReferralDoctorSameBranch, - referralDoctorName: - model.patientReferral[0].referredByDoctorInfo, - clinicDescription: null, - remark: - model.patientReferral[0].remarksFromSource - ), + patientName: model.patientReferral[0].patientName, + referralStatus: + "${model.patientReferral[0].referralStatus}", + isReferredTo: true, + isSameBranch: model + .patientReferral[0].isReferralDoctorSameBranch, + referralDoctorName: + model.patientReferral[0].referredByDoctorInfo, + clinicDescription: null, + remark: model.patientReferral[0].remarksFromSource), ], ), if (model.patientReferral.length == 0) @@ -124,7 +124,7 @@ class _PatientMakeReferralScreenState extends State { .makeReferral( patient, appointmentDate.toIso8601String(), - _selectedBranch['ID'], + _selectedBranch['facilityId'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) @@ -180,7 +180,12 @@ class _PatientMakeReferralScreenState extends State { model.getDoctorBranch().then((value) { _selectedBranch = value; if (_referTo['id'] == 1) { - model.getClinics(_selectedBranch['ID']); + GifLoaderDialogUtils.showMyDialog(context); + model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); } }); }); @@ -217,15 +222,19 @@ class _PatientMakeReferralScreenState extends State { ? () { ListSelectDialog dialog = ListSelectDialog( list: model.branchesList, - attributeName: 'Desciption', - attributeValueId: 'ID', + attributeName: 'facilityName', + attributeValueId: 'facilityId', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { _selectedBranch = selectedValue; _selectedClinic = null; _selectedDoctor = null; - model.getClinics(_selectedBranch['ID']); + GifLoaderDialogUtils.showMyDialog(context); + model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); }); }, ); @@ -242,7 +251,7 @@ class _PatientMakeReferralScreenState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of(context).branch, _selectedBranch != null - ? _selectedBranch['Desciption'] + ? _selectedBranch['facilityName'] : null, true), enabled: false, @@ -268,8 +277,12 @@ class _PatientMakeReferralScreenState extends State { setState(() { _selectedDoctor = null; _selectedClinic = selectedValue; - model.getClinicDoctors( - _selectedClinic['ClinicID'].toString()); + GifLoaderDialogUtils.showMyDialog(context); + model + .getClinicDoctors( + _selectedClinic['ClinicID'].toString()) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); }); }, ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index ad312625..45cd8d14 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -9,13 +10,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int appointmentNo; int projectID; bool isNotOneAppointment; - VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true}); + + VitalSignDetailsScreen( + {this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { @@ -23,10 +26,11 @@ class VitalSignDetailsScreen extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String from = routeArgs['from']; String to = routeArgs['to']; - String imageBasePath = 'assets/images/'; + String imageBasePath = 'assets/images/'; return BaseView( - onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to), + onModelReady: (model) => + model.getPatientVitalSignHistory(patient, from, to), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, baseViewModel: mode, @@ -38,16 +42,19 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () =>isNotOneAppointment? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: TranslationBase.of(context).height, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: + TranslationBase.of(context).height, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).height, @@ -58,16 +65,19 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: TranslationBase.of(context).weight, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: + TranslationBase.of(context).weight, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).weight, imagePath: "${imageBasePath}vital_weight.png", @@ -80,17 +90,20 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BodyMeasurements, - pageTitle: TranslationBase.of(context) - .bodyMeasurements, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ): null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.BodyMeasurements, + pageTitle: TranslationBase.of(context) + .bodyMeasurements, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).body, imagePath: "${imageBasePath}vital_body_mass.png", @@ -99,21 +112,24 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: - TranslationBase.of(context).temperature, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context) + .temperature, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).temperature, - imagePath: "${imageBasePath}vital_temperature.png", + imagePath: + "${imageBasePath}vital_temperature.png", lastVal: mode.temperatureCelcius, unit: TranslationBase.of(context).tempC, ), @@ -124,16 +140,19 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: TranslationBase.of(context).heart, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: + TranslationBase.of(context).heart, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).heart, imagePath: "${imageBasePath}vital_heart_rate.png", @@ -142,17 +161,19 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: - TranslationBase.of(context).respirationRate, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context) + .respirationRate, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).respirationRate, imagePath: "${imageBasePath}vital_respiration.png", @@ -166,19 +187,23 @@ class VitalSignDetailsScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context).bloodPressure, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context) + .bloodPressure, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).bloodPressure, - imagePath: "${imageBasePath}vital_blood-pressure.png", + imagePath: + "${imageBasePath}vital_blood-pressure.png", lastVal: mode.bloodPressure, unit: TranslationBase.of(context).sysDias, ), @@ -189,7 +214,12 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ) : Center( - child: AppText('No Data'), + child: AppText( + TranslationBase.of(context).vitalSignEmptyMsg, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), ), ), ); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 43a51237..a49873a7 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1013,21 +1013,30 @@ class TranslationBase { String get createdBy => localizedValues['createdBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; + String get noItem => localizedValues['noItem'][locale.languageCode]; + String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String get active => localizedValues['active'][locale.languageCode]; + String get hold => localizedValues['hold'][locale.languageCode]; + String get loading => localizedValues['loading'][locale.languageCode]; String get assessmentErrorMsg => localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => localizedValues['examinationErrorMsg'][locale.languageCode]; @@ -1036,10 +1045,14 @@ class TranslationBase { String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; + String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + + String get icd => localizedValues['icd'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index fa33a72d..b6df1f6f 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -47,8 +47,8 @@ class _ListSelectDialogState extends State { Widget continueButton = FlatButton( child: Text(this.widget.okText), onPressed: () { - this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); + this.widget.okFunction(widget.selectedValue); }); // set up the AlertDialog AlertDialog alert = AlertDialog( From d34744e16859a04282d162a571594e3df8a81c3b Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 27 Jan 2021 11:39:48 +0300 Subject: [PATCH 2/3] bug fix --- assets/images/Doctor_app_logo.png | Bin 0 -> 9713 bytes lib/widgets/auth/login_form.dart | 11 ++++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 assets/images/Doctor_app_logo.png diff --git a/assets/images/Doctor_app_logo.png b/assets/images/Doctor_app_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2de2d46002571791ee2343f07957e2322ae1a599 GIT binary patch literal 9713 zcmcI~c|4Tw_xF%x>_e7GVn_^G#*i&bCS>12lw=xXU&e0iyX-;~*$c_8NXV9mY#~G> zWl0)qcAm@k`}usH-|Kn(e$Vs$=kdB{=AL`5`&{Qb=UngeKIax=pm&XdmXj6&fiP%l zs2YJ!>ysCh3cM4(Jun6zGz1NE4+wFUViT%EGK6ny1@0B5`>7UApcSB?L3HuN`ii=Eoc~*b zD&7OgxXA zhdMj|Gup#b%^S?}m%jh4U=L#=0WWTZ_i*)c$Klny@h+a{|DMbm_s_iqFL$SZt<)MP zj(5U4gJB*(F^PYsBG|clx_a2T{txT;=jVS`Ly*7fj>mesx*NN?I{ob^gTJL9&}cCf z0;!9|*}I&`6*|%BuUqh{SWmnnAMl%mC`v*UeaTotN?rmbFM+;@l9WfG{ykI|M1nQe z6Z@YHcD1&*A^s;rb#>)6T|7LoE;ziVsv;jyO3dEgT3!-wEhB}K#*0dzq;R5AGFS;w ztQ=lOR8AIuS5^`$AuENK{g+5?DLGMDv=mxYMgonyYa=5gX^oZmTbjPRJ=i-~r~fMTL@VnPtuEngByo3vR#I4? z70%jPR8|^?7DeN1q|s6`HaH1sX+DHCPTt1V-5Coa#oiffix(%j*zzI%w>DQ@om|~@ zU9Ex5B~RiRNC&IXu=fDYBmT8RuH)VQI&-o|{44C_vAC0HSLDN;xEXKF_t$0n|IT{< zk)Hn+>tlxpLjNz$|MxHtR~t_stUF%C7FhZ}2ru#fNqrBj_y0rr|H$?KUzPvMv^YDg zi!C0&r#Roqa>P%7=HHGH|37{9uiyR)DE&PgAl=F7KM)JP`~%W>7a-alK=63I783-* z^IlU`#n|`pN+8jbYqVj3^y%a1Xq?}5$J!B=nu5M8k+biuaN)dBR!~hdCvyI#WO{4f zq-0{phh&*#1$Tjn50Ch5Eiv3gqNb(BUBszJ*Q#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s|F-4^Pgv@Abv+kEoptLE=CPo7 zj|H8SqWFPL5bJv~x_WDs@Oz$Tk?DA>6z6?wxUai^=hr*u*yCZ6WV9+|$sVK{U2)Ou z;g-JHN^ZJL0n3gODAg&@?ghyj5%Cq~tHG1)@s((1fJwj37Au0Yvx9;N2R##B+Q&~a zT;~- z97x`AH7}@R#`bkSQxl$HHu0r_A31a^d_iS@N}gf+rsW*Hn9XPi=Th52hX%~?^XE@2 z3eGG*aZIi_a)#}OxE|}Y*9?5{3rSqJwLgx&s(iD@0~TCTQ9;E^ z5pJ~>U(_P9eR}!Q*x^w1R^6R>zZuHZa!HL%?@OM+TXg;-YvUK3A;HGDRXX9;^xUL_ z070W?ta`b6KJPqKIx}J@Ht_B?QkTjmZf!O51jb%ki1cXQE{K4H{Nk>V-59A4l1p{k znZOjX4mkKd=3ffOnwy*N3CVH1sxe}afl;2-pq;w#D_52SXlT|}=O6q~yKdk5!@XpB zmgd_GN6Lq5M>|~897^Q@YWSAP;g&roBWV_lfoZx+xs;UD!-NOlH!RjO1A6Te-owRU zo;3IIwueTTP+nn4rtj|aO;uZ&eU)Z1mfJl}Ik8N9f*2+GS6_awR|fp(^;f@k?II-a zi8W2U`gtmE#^~iGchsUAV(A+ z3yO-UxRW@z2NqwjnbUW)&T7bf$Q7>6nv>nl@&CQsc9kh`cTHO+d;(|4LJp}Bp;O+U zsMSCGQ{Qqp@TlccpN+AxaR^?HBAg674!Jrk1s<=(b { projectIdController.text = projectsList[0]['facilityName']; }); } else { + print(res); // handel error - setState(() { - projectsList = ListProject; - }); + // setState(() { + // projectsList = ListProject; + // }); } }).catchError((err) { setState(() { - projectsList = ListProject; + print(err); }); print(err); }); @@ -386,6 +387,6 @@ class _LoginFormState extends State { getProjectsList(value); } } - _isInit = false; + //_isInit = false; } } From 2273808333ce236bb723e94a02a29af0e15b3fbe Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 27 Jan 2021 10:56:05 +0200 Subject: [PATCH 3/3] translation --- lib/screens/patients/patients_screen.dart | 2 +- lib/util/date-utils.dart | 4 ++-- lib/widgets/patients/profile/patient_profile_widget.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 1a55153e..50b89148 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -616,7 +616,7 @@ class _PatientsScreenState extends State { .white, ), AppText( - " ${DateUtils.getAgeByBirthday(item.dateofBirth)}", + " ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}", fontSize: 1.8 * SizeConfig diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 84b4167f..af90acf6 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -217,7 +217,7 @@ class DateUtils { } } - static String getAgeByBirthday(dynamic birthday){ + static String getAgeByBirthday(dynamic birthday, BuildContext context){ // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); final now = DateTime.now(); @@ -232,7 +232,7 @@ class DateUtils { final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); days = now.difference(monthAgo).inDays + 1; } - return "$years Yr $months Mnth $days Day"; + return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}"; } } diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index c289431b..4834e412 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -117,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}", + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}", fontWeight: FontWeight.normal, fontSize: 1.6 * SizeConfig.textMultiplier, ),