|  |  | @ -1,20 +1,29 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'dart:math'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:dartz/dartz.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:easy_localization/easy_localization.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:flutter/material.dart'; |  |  |  | import 'package:flutter/material.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/app_assets.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/app_assets.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/core/common_models/data_points.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/core/utils/utils.dart'; |  |  |  | import 'package:hmg_patient_app_new/core/utils/utils.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; |  |  |  | import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; |  |  |  | import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/features/lab/history/lab_history_viewmodel.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/features/lab/lab_range_view_model.dart' show LabRangeViewModel; |  |  |  | import 'package:hmg_patient_app_new/features/lab/lab_range_view_model.dart' show LabRangeViewModel; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; |  |  |  | import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/features/lab/models/resp_models/lab_result.dart'; |  |  |  | import 'package:hmg_patient_app_new/features/lab/models/resp_models/lab_result.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_results/lab_result_calender.dart'; |  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_results/lab_result_calender.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_results/lab_result_list_item.dart'; |  |  |  | import 'package:hmg_patient_app_new/presentation/lab/lab_results/lab_result_list_item.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/theme/colors.dart' show AppColors; |  |  |  | import 'package:hmg_patient_app_new/theme/colors.dart' show AppColors; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:hmg_patient_app_new/widgets/graph/custom_graph.dart'; |  |  |  | import 'package:hmg_patient_app_new/widgets/graph/custom_graph.dart'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import 'package:provider/provider.dart' show Consumer, Provider; |  |  |  | import 'package:provider/provider.dart' show Consumer, Provider; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import '../../../widgets/common_bottom_sheet.dart' show showCommonBottomSheetWithoutHeight; |  |  |  | import '../../../widgets/common_bottom_sheet.dart' | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     show showCommonBottomSheetWithoutHeight; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import '../../book_appointment/widgets/appointment_calendar.dart' | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     show AppointmentCalendar; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | class LabResultDetails extends StatelessWidget { |  |  |  | class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |   final LabResult recentLabResult; |  |  |  |   final LabResult recentLabResult; | 
			
		
	
	
		
		
			
				
					|  |  | @ -54,12 +63,18 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |             children: [ |  |  |  |             children: [ | 
			
		
	
		
		
			
				
					
					|  |  |  |               Text( |  |  |  |               Text( | 
			
		
	
		
		
			
				
					
					|  |  |  |                 recentLabResult.testCode ?? "", |  |  |  |                 recentLabResult.testCode ?? "", | 
			
		
	
		
		
			
				
					
					|  |  |  |                 style: TextStyle(fontSize: 32, fontWeight: FontWeight.w600, color: AppColors.textColor, letterSpacing: -2), |  |  |  |                 style: TextStyle( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     fontSize: 32, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     fontFamily: 'Poppins', | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     fontWeight: FontWeight.w600, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     color: AppColors.textColor, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     letterSpacing: -2), | 
			
		
	
		
		
			
				
					
					|  |  |  |               ), |  |  |  |               ), | 
			
		
	
		
		
			
				
					
					|  |  |  |               Text( |  |  |  |               Text( | 
			
		
	
		
		
			
				
					
					|  |  |  |                 "Result of ${recentLabResult.verifiedOn ?? ""}".needTranslation, |  |  |  |                 "Result of ${recentLabResult.verifiedOn ?? ""}".needTranslation, | 
			
		
	
		
		
			
				
					
					|  |  |  |                 style: TextStyle( |  |  |  |                 style: TextStyle( | 
			
		
	
		
		
			
				
					
					|  |  |  |                   fontSize: 12, |  |  |  |                   fontSize: 12, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                   fontFamily: 'Poppins', | 
			
		
	
		
		
			
				
					
					|  |  |  |                   fontWeight: FontWeight.w500, |  |  |  |                   fontWeight: FontWeight.w500, | 
			
		
	
		
		
			
				
					
					|  |  |  |                   color: AppColors.greyTextColor, |  |  |  |                   color: AppColors.greyTextColor, | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ), |  |  |  |                 ), | 
			
		
	
	
		
		
			
				
					|  |  | @ -73,6 +88,7 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |               Expanded( |  |  |  |               Expanded( | 
			
		
	
		
		
			
				
					
					|  |  |  |                 child: Row( |  |  |  |                 child: Row( | 
			
		
	
		
		
			
				
					
					|  |  |  |                   spacing: 4.h, |  |  |  |                   spacing: 4.h, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                   children: [ |  |  |  |                   children: [ | 
			
		
	
		
		
			
				
					
					|  |  |  |                     Flexible( |  |  |  |                     Flexible( | 
			
		
	
		
		
			
				
					
					|  |  |  |                       child: Text( |  |  |  |                       child: Text( | 
			
		
	
	
		
		
			
				
					|  |  | @ -80,6 +96,7 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         style: TextStyle( |  |  |  |                         style: TextStyle( | 
			
		
	
		
		
			
				
					
					|  |  |  |                           fontSize: 24.fSize, |  |  |  |                           fontSize: 24.fSize, | 
			
		
	
		
		
			
				
					
					|  |  |  |                           fontWeight: FontWeight.w600, |  |  |  |                           fontWeight: FontWeight.w600, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                           fontFamily: 'Poppins', | 
			
		
	
		
		
			
				
					
					|  |  |  |                           color: model.getColor( |  |  |  |                           color: model.getColor( | 
			
		
	
		
		
			
				
					
					|  |  |  |                             recentLabResult.calculatedResultFlag ?? "", |  |  |  |                             recentLabResult.calculatedResultFlag ?? "", | 
			
		
	
		
		
			
				
					
					|  |  |  |                           ), |  |  |  |                           ), | 
			
		
	
	
		
		
			
				
					|  |  | @ -97,6 +114,7 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         style: TextStyle( |  |  |  |                         style: TextStyle( | 
			
		
	
		
		
			
				
					
					|  |  |  |                           fontSize: 12.fSize, |  |  |  |                           fontSize: 12.fSize, | 
			
		
	
		
		
			
				
					
					|  |  |  |                           fontWeight: FontWeight.w500, |  |  |  |                           fontWeight: FontWeight.w500, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                           fontFamily: 'Poppins', | 
			
		
	
		
		
			
				
					
					|  |  |  |                           color: AppColors.greyTextColor, |  |  |  |                           color: AppColors.greyTextColor, | 
			
		
	
		
		
			
				
					
					|  |  |  |                         ), |  |  |  |                         ), | 
			
		
	
		
		
			
				
					
					|  |  |  |                         overflow: TextOverflow.ellipsis, |  |  |  |                         overflow: TextOverflow.ellipsis, | 
			
		
	
	
		
		
			
				
					|  |  | @ -117,6 +135,7 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |               ), |  |  |  |               ), | 
			
		
	
		
		
			
				
					
					|  |  |  |             ], |  |  |  |             ], | 
			
		
	
		
		
			
				
					
					|  |  |  |           ) |  |  |  |           ) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         ], |  |  |  |         ], | 
			
		
	
		
		
			
				
					
					|  |  |  |       )); |  |  |  |       )); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -141,6 +160,8 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |                           model.isGraphVisible?"History FlowChart".needTranslation: "History".needTranslation, |  |  |  |                           model.isGraphVisible?"History FlowChart".needTranslation: "History".needTranslation, | 
			
		
	
		
		
			
				
					
					|  |  |  |                           style: TextStyle( |  |  |  |                           style: TextStyle( | 
			
		
	
		
		
			
				
					
					|  |  |  |                             fontSize: 16, |  |  |  |                             fontSize: 16, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             fontFamily: 'Poppins', | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                             fontWeight: FontWeight.w600, |  |  |  |                             fontWeight: FontWeight.w600, | 
			
		
	
		
		
			
				
					
					|  |  |  |                             color: AppColors.textColor, |  |  |  |                             color: AppColors.textColor, | 
			
		
	
		
		
			
				
					
					|  |  |  |                           ), |  |  |  |                           ), | 
			
		
	
	
		
		
			
				
					|  |  | @ -149,15 +170,24 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |                           spacing: 16.h, |  |  |  |                           spacing: 16.h, | 
			
		
	
		
		
			
				
					
					|  |  |  |                           children: [ |  |  |  |                           children: [ | 
			
		
	
		
		
			
				
					
					|  |  |  |                             //todo handle when the graph icon is being displayed |  |  |  |                             //todo handle when the graph icon is being displayed | 
			
		
	
		
		
			
				
					
					|  |  |  |                             Utils.buildSvgWithAssets(icon: model.isGraphVisible ? AppAssets.ic_list : AppAssets.ic_graph, width: 24, height: 24).onPress(() { |  |  |  |                             Utils.buildSvgWithAssets( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     icon: model.isGraphVisible?AppAssets.ic_list:AppAssets.ic_graph, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     width: 24, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     height: 24) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 .onPress(() { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                   model.alterGraphVisibility(); |  |  |  |                                   model.alterGraphVisibility(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             }), |  |  |  |                             }), | 
			
		
	
		
		
			
				
					
					|  |  |  |                             Utils.buildSvgWithAssets(icon: AppAssets.ic_date_filter, width: 24, height: 24).onPress(() { |  |  |  |                             Utils.buildSvgWithAssets( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     icon: AppAssets.ic_date_filter, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     width: 24, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     height: 24) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 .onPress(() { | 
			
		
	
		
		
			
				
					
					|  |  |  |                               showCommonBottomSheetWithoutHeight( |  |  |  |                               showCommonBottomSheetWithoutHeight( | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 title: "Set The Date Range".needTranslation, |  |  |  |                                 title: "Set The Date Range".needTranslation, | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 context, |  |  |  |                                 context, | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 child: LabResultCalender( |  |  |  |                                 child: LabResultCalender( | 
			
		
	
		
		
			
				
					
					|  |  |  |                                   onRangeSelected: (start, end) { |  |  |  |                                   onRangeSelected: (start, end) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     // if (start != null) { |  |  |  |                                     // if (start != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                       labmodel.getSelectedDateRange(start, end); |  |  |  |                                       labmodel.getSelectedDateRange(start, end); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     // } |  |  |  |                                     // } | 
			
		
	
	
		
		
			
				
					|  |  | @ -181,7 +211,7 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |     return Text( |  |  |  |     return Text( | 
			
		
	
		
		
			
				
					
					|  |  |  |       value, |  |  |  |       value, | 
			
		
	
		
		
			
				
					
					|  |  |  |       style: TextStyle( |  |  |  |       style: TextStyle( | 
			
		
	
		
		
			
				
					
					|  |  |  |         fontWeight: FontWeight.w300, |  |  |  |         fontWeight: FontWeight.w600, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         fontFamily: 'Poppins', |  |  |  |         fontFamily: 'Poppins', | 
			
		
	
		
		
			
				
					
					|  |  |  |         fontSize: 8.fSize, |  |  |  |         fontSize: 8.fSize, | 
			
		
	
		
		
			
				
					
					|  |  |  |         color: AppColors.textColor, |  |  |  |         color: AppColors.textColor, | 
			
		
	
	
		
		
			
				
					|  |  | @ -194,32 +224,47 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |       padding: const EdgeInsets.only(top:8.0), |  |  |  |       padding: const EdgeInsets.only(top:8.0), | 
			
		
	
		
		
			
				
					
					|  |  |  |       child: Text( |  |  |  |       child: Text( | 
			
		
	
		
		
			
				
					
					|  |  |  |         label, |  |  |  |         label, | 
			
		
	
		
		
			
				
					
					|  |  |  |         style: TextStyle(fontSize: 8.fSize, fontFamily: 'Poppins', fontWeight: FontWeight.w600, color: AppColors.labelTextColor), |  |  |  |         style: TextStyle( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             fontSize: 8.fSize, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             fontFamily: 'Poppins', | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             fontWeight: FontWeight.w600, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             color: AppColors.labelTextColor), | 
			
		
	
		
		
			
				
					
					|  |  |  |       ), |  |  |  |       ), | 
			
		
	
		
		
			
				
					
					|  |  |  |     ); |  |  |  |     ); | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   Widget historyBody(LabRangeViewModel model, LabViewModel labmodel) { |  |  |  |   Widget historyBody(LabRangeViewModel model, LabViewModel labmodel) { | 
			
		
	
		
		
			
				
					
					|  |  |  |     if(model.isGraphVisible){ |  |  |  |     if(model.isGraphVisible){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       var graphColor = labmodel.getColor(recentLabResult.calculatedResultFlag??"N"); | 
			
		
	
		
		
			
				
					
					|  |  |  |       return CustomGraph( |  |  |  |       return CustomGraph( | 
			
		
	
		
		
			
				
					
					|  |  |  |           dataPoints: labmodel.filteredGraphValues, |  |  |  |           dataPoints: labmodel.filteredGraphValues, | 
			
		
	
		
		
			
				
					
					|  |  |  |           maxY: 100, |  |  |  |           // maxY: 100, | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           makeGraphBasedOnActualValue: true, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           leftLabelReservedSize: 40, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           leftLabelInterval: getInterval(labmodel), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           maxY: (labmodel.maxY)+(getInterval(labmodel)??0)/2, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           leftLabelFormatter: (value) { |  |  |  |           leftLabelFormatter: (value) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             switch (value.toInt()) { |  |  |  |             return leftLabels(value.toStringAsFixed(2).tr()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               case 20: |  |  |  |             // switch (value.toInt()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return leftLabels("Critical Low".needTranslation); |  |  |  |             //   case 10: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               case 40: |  |  |  |             //     return leftLabels("Critical Low".needTranslation); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return leftLabels("Low".needTranslation); |  |  |  |             //   case 30: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               case 60: |  |  |  |             //     return leftLabels("Low".needTranslation); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return leftLabels("Normal".needTranslation); |  |  |  |             //   case 50: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               case 80: |  |  |  |             //     return leftLabels("Normal".needTranslation); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return leftLabels("High".needTranslation); |  |  |  |             //   case 70: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               case 100: |  |  |  |             //     return leftLabels("High".needTranslation); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return leftLabels("Critical High".needTranslation); |  |  |  |             //   case 90: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               default: |  |  |  |             //     return leftLabels( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return SizedBox.shrink(); |  |  |  |             //         "Critical High".needTranslation); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             //   default: | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //     return SizedBox.shrink(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             // } | 
			
		
	
		
		
			
				
					
					|  |  |  |           }, |  |  |  |           }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           graphColor:graphColor , | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           graphShadowColor: graphColor.withOpacity(.4), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           graphGridColor: graphColor.withOpacity(.4), | 
			
		
	
		
		
			
				
					
					|  |  |  |           bottomLabelFormatter: (value, data) { |  |  |  |           bottomLabelFormatter: (value, data) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             if(data.isEmpty) return SizedBox.shrink(); |  |  |  |             if(data.isEmpty) return SizedBox.shrink(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (value == 0) { |  |  |  |             if (value == 0) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -233,6 +278,7 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             return SizedBox.shrink(); |  |  |  |             return SizedBox.shrink(); | 
			
		
	
		
		
			
				
					
					|  |  |  |           }, |  |  |  |           }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           minX:(labmodel.filteredGraphValues.length == 1)?null : -.2, | 
			
		
	
		
		
			
				
					
					|  |  |  |           scrollDirection: Axis.horizontal, |  |  |  |           scrollDirection: Axis.horizontal, | 
			
		
	
		
		
			
				
					
					|  |  |  |           height: 180.h); |  |  |  |           height: 180.h); | 
			
		
	
		
		
			
				
					
					|  |  |  |     }else { |  |  |  |     }else { | 
			
		
	
	
		
		
			
				
					|  |  | @ -245,14 +291,13 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |       height: 180.h, |  |  |  |       height: 180.h, | 
			
		
	
		
		
			
				
					
					|  |  |  |       child: ListView.separated( |  |  |  |       child: ListView.separated( | 
			
		
	
		
		
			
				
					
					|  |  |  |         padding: EdgeInsets.zero, |  |  |  |         padding: EdgeInsets.zero, | 
			
		
	
		
		
			
				
					
					|  |  |  |         itemCount: labmodel.filteredGraphValues.length, |  |  |  |           itemCount: labmodel.filteredGraphValues.length,itemBuilder: (context, index){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         itemBuilder: (context, index) { |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         var data = labmodel.filteredGraphValues.reversed.toList()[index]; |  |  |  |         var data = labmodel.filteredGraphValues.reversed.toList()[index]; | 
			
		
	
		
		
			
				
					
					|  |  |  |           return LabHistoryItem( |  |  |  |           return LabHistoryItem( | 
			
		
	
		
		
			
				
					
					|  |  |  |             dayNameAndDate: labmodel.getFormattedDate(data.time), |  |  |  |             dayNameAndDate: labmodel.getFormattedDate(data.time), | 
			
		
	
		
		
			
				
					
					|  |  |  |             result: data.actualValue, |  |  |  |             result: data.actualValue, | 
			
		
	
		
		
			
				
					
					|  |  |  |             assetUrl: labmodel.getAssetUrlWRTResult(data.refernceValue), |  |  |  |             assetUrl: labmodel.getAssetUrlWRTResult(data.referenceValue), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             shouldRotateIcon: labmodel.getRotationWRTResult(data.refernceValue), |  |  |  |             shouldRotateIcon: labmodel.getRotationWRTResult(data.referenceValue), | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           ); |  |  |  |           ); | 
			
		
	
		
		
			
				
					
					|  |  |  |         }, |  |  |  |         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |         separatorBuilder: (_, __) => Divider( |  |  |  |         separatorBuilder: (_, __) => Divider( | 
			
		
	
	
		
		
			
				
					|  |  | @ -262,4 +307,14 @@ class LabResultDetails extends StatelessWidget { | 
			
		
	
		
		
			
				
					
					|  |  |  |       ), |  |  |  |       ), | 
			
		
	
		
		
			
				
					
					|  |  |  |     ); |  |  |  |     ); | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   double? getInterval(LabViewModel labmodel) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     var maxX = labmodel.maxY; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if(maxX >1 && maxX < 5) return 1; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if(maxX >5 && maxX < 10) return 5; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if(maxX >10 && maxX < 50) return 10; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if(maxX >50 && maxX < 100) return 20; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     if(maxX >100 && maxX < 200) return 30; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     return 50; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |