diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 59cdf14c..1cf7499c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -328,4 +328,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index faa5405e..132cc214 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -131,7 +131,7 @@ class _LiveCarePatientScreenState extends State { arrivalType: "0", isFromSearch: false, isInpatient: false, - isFromLiveCare:true, + isFromLiveCare:true, onTap: () { // TODO change the parameter to daynamic Navigator.of(context).pushNamed( @@ -143,6 +143,7 @@ class _LiveCarePatientScreenState extends State { "isInpatient": false, "arrivalType": "0", "isSearchAndOut": false, + "isFromLiveCare":true }); }, // isFromSearch: widget.isSearch, diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 7a0305e4..dc4324ec 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -97,18 +97,16 @@ class _PatientProfileScreenState extends State Column( children: [ PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient:isDischargedPatient - ), + patient, arrivalType ?? '0', patientType, + isInpatient: isInpatient, + isFromLiveCare: isFromLiveCare, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), Container( height: !isSearchAndOut ? isDischargedPatient diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index adddc292..fb68ab4e 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -305,12 +305,13 @@ class AppDateUtils { return DateFormat('hh:mm a').format(dateTime); } - static String getAgeByBirthday(dynamic birthday, BuildContext context, { bool isServerFormat = true}) { + static String getAgeByBirthday(String birthOfDate, BuildContext context, { bool isServerFormat = true}) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate; - if(isServerFormat){ birthDate = AppDateUtils.getDateTimeFromServerFormat(birthday); + if(birthOfDate.contains("/Date")) { + birthDate = AppDateUtils.getDateTimeFromServerFormat(birthOfDate); }else{ - birthDate = DateTime.parse('1986-08-15'); + birthDate = DateTime.parse(birthOfDate); } final now = DateTime.now(); int years = now.year - birthDate.year; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 795a01bf..995ac57a 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -19,9 +19,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final double height; final bool isInpatient; final bool isDischargedPatient; + final bool isFromLiveCare; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false}); @override Widget build(BuildContext context) { @@ -152,7 +153,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget )) : SizedBox(), if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") + "List_MyOutPatient" && !isFromLiveCare) Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -182,15 +183,14 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget SizedBox( width: 3.5, ), - - Container( - child: AppText( - convertDateFormat2( - patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + Container( + child: AppText( + convertDateFormat2( + patient.appointmentDate ?? ''), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), ), - ), SizedBox( height: 0.5, ) @@ -261,7 +261,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,isServerFormat: !isFromLiveCare)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ],