diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 51c5b35b..1064036f 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -167,93 +167,95 @@ class PatientSickLeaveScreen extends StatelessWidget { SizedBox( width: 10, ), - Column( - children: [ - CustomRow( - label: TranslationBase.of( - context) - .daysSickleave , - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: (item.sickLeaveDays - .toString() != - null && - item.sickLeaveDays - .toString() != - "null") - ? item.sickLeaveDays - .toString() - : item.noOfDays - .toString(), - ), - CustomRow( - label: TranslationBase.of( - context) - .startDate + - ' ' ?? - "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item - .startDate) - : DateTime.parse( - item.startDate), + Expanded( + child: Column( + children: [ + CustomRow( + label: TranslationBase.of( + context) + .daysSickleave , + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: (item.sickLeaveDays + .toString() != + null && + item.sickLeaveDays + .toString() != + "null") + ? item.sickLeaveDays + .toString() + : item.noOfDays + .toString(), ), - ), - CustomRow( - label: TranslationBase.of( - context) - .endDate + - ' ' ?? - "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item.endDate ?? - "") - .add( - Duration( - days: item - .noOfDays ?? - item.sickLeaveDays), - ) - : DateTime.parse( - item.startDate ?? - "") - .add( - Duration( - days: - item.noOfDays ?? - ""), - ), + CustomRow( + label: TranslationBase.of( + context) + .startDate + + ' ' ?? + "", + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: AppDateUtils + .getDayMonthYearDateFormatted( + item.startDate.contains( + "/Date(") + ? AppDateUtils + .convertStringToDate( + item + .startDate) + : DateTime.parse( + item.startDate), + ), ), - ), - ], - crossAxisAlignment: - CrossAxisAlignment.start, + CustomRow( + label: TranslationBase.of( + context) + .endDate + + ' ' ?? + "", + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: AppDateUtils + .getDayMonthYearDateFormatted( + item.startDate.contains( + "/Date(") + ? AppDateUtils + .convertStringToDate( + item.endDate ?? + "") + .add( + Duration( + days: item + .noOfDays ?? + item.sickLeaveDays), + ) + : DateTime.parse( + item.startDate ?? + "") + .add( + Duration( + days: + item.noOfDays ?? + ""), + ), + ), + ), + ], + crossAxisAlignment: + CrossAxisAlignment.start, + ), ), ], ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index d0416539..0910c1c1 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -117,20 +117,20 @@ class VitalSingChartBloodPressure extends StatelessWidget { (element) { DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.createdOn); - if (element.toJson()[viewKey1]?.toInt() != 0) + if (element.toJson()[viewKey1]?.toInt() != 0 && element.toJson()[viewKey1]?.toInt() != null) timeSeriesData1.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.toJson()[viewKey1].toDouble(), + element.toJson()[viewKey1]?.toDouble(), ), ); - if (element.toJson()[viewKey2]?.toInt() != 0) + if (element.toJson()[viewKey2]?.toInt() != 0 && element.toJson()[viewKey2]?.toInt() != null) timeSeriesData2.add( TimeSeriesSales2( new DateTime( elementDate.year, elementDate.month, elementDate.day), - element.toJson()[viewKey2].toDouble(), + element.toJson()[viewKey2]?.toDouble(), ), ); },