|
|
|
|
@ -284,15 +284,14 @@ class LabResultDetails extends StatelessWidget {
|
|
|
|
|
leftLabelInterval: getInterval(labmodel),
|
|
|
|
|
// maxY: (labmodel.maxY)+(getInterval(labmodel)??0)/2,
|
|
|
|
|
maxY: (labmodel.maxY),
|
|
|
|
|
minY: labmodel.minY,
|
|
|
|
|
maxX: labmodel.filteredGraphValues.length.toDouble()-.75,
|
|
|
|
|
horizontalInterval: .1,
|
|
|
|
|
getDrawingHorizontalLine: (value){
|
|
|
|
|
print("the FLline transformed line is $value");
|
|
|
|
|
print("the labmodel.highTransformedReferenceValue is ${labmodel.highTransformedReferenceValue}");
|
|
|
|
|
print("thelabmodel.lowTransformedReferenceValue is ${labmodel.lowTransformedReferenceValue}");
|
|
|
|
|
if(value == labmodel.highRefrenceValue ||value== labmodel.highRefrenceValue) {
|
|
|
|
|
value = double.parse(value.toStringAsFixed(1));
|
|
|
|
|
if(value == labmodel.highRefrenceValue ||value== labmodel.lowRefenceValue) {
|
|
|
|
|
return FlLine(
|
|
|
|
|
color: AppColors.greyTextColor,
|
|
|
|
|
color: AppColors.bgGreenColor.withOpacity(0.6),
|
|
|
|
|
strokeWidth: 1,
|
|
|
|
|
// dashArray: [5, 5],
|
|
|
|
|
);
|
|
|
|
|
@ -300,35 +299,22 @@ class LabResultDetails extends StatelessWidget {
|
|
|
|
|
return FlLine(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
strokeWidth: 1,
|
|
|
|
|
// dashArray: [5, 5],
|
|
|
|
|
);;
|
|
|
|
|
},
|
|
|
|
|
leftLabelFormatter: (value) {
|
|
|
|
|
value = double.parse(value.toStringAsFixed(1));
|
|
|
|
|
// return leftLabels(value.toStringAsFixed(2));
|
|
|
|
|
if(value == labmodel.highTransformedReferenceValue)
|
|
|
|
|
if(value == labmodel.highRefrenceValue)
|
|
|
|
|
return leftLabels("High".needTranslation);
|
|
|
|
|
|
|
|
|
|
if(value== labmodel.lowTransformedReferenceValue)
|
|
|
|
|
if(value== labmodel.lowRefenceValue)
|
|
|
|
|
return leftLabels("Low".needTranslation);
|
|
|
|
|
|
|
|
|
|
// switch (value.toInt()) {
|
|
|
|
|
// case 10:
|
|
|
|
|
// return leftLabels("Critical Low".needTranslation);
|
|
|
|
|
// case 30:
|
|
|
|
|
// return leftLabels("Low".needTranslation);
|
|
|
|
|
// case 50:
|
|
|
|
|
// return leftLabels("Normal".needTranslation);
|
|
|
|
|
// case 70:
|
|
|
|
|
// return leftLabels("High".needTranslation);
|
|
|
|
|
// case 90:
|
|
|
|
|
// return leftLabels(
|
|
|
|
|
// "Critical High".needTranslation);
|
|
|
|
|
// default:
|
|
|
|
|
return SizedBox.shrink();
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
graphColor:graphColor ,
|
|
|
|
|
graphShadowColor: graphColor.withOpacity(.1),
|
|
|
|
|
graphColor:AppColors.blackColor,
|
|
|
|
|
graphShadowColor: Colors.transparent,
|
|
|
|
|
graphGridColor: graphColor.withOpacity(.4),
|
|
|
|
|
bottomLabelFormatter: (value, data) {
|
|
|
|
|
if(data.isEmpty) return SizedBox.shrink();
|
|
|
|
|
@ -343,6 +329,9 @@ class LabResultDetails extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
return SizedBox.shrink();
|
|
|
|
|
},
|
|
|
|
|
rangeAnnotations: RangeAnnotations(
|
|
|
|
|
horizontalRangeAnnotations: _buildRangeShades(labmodel)
|
|
|
|
|
),
|
|
|
|
|
minX:(labmodel.filteredGraphValues.length == 1)?null : -.2,
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
height: 180.h);
|
|
|
|
|
@ -351,6 +340,29 @@ class LabResultDetails extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<HorizontalRangeAnnotation> _buildRangeShades( LabViewModel model,) {
|
|
|
|
|
List<HorizontalRangeAnnotation> ranges = [];
|
|
|
|
|
|
|
|
|
|
ranges.add(HorizontalRangeAnnotation(
|
|
|
|
|
y1:model.minY,
|
|
|
|
|
y2: model.lowRefenceValue,
|
|
|
|
|
color: AppColors.highAndLow.withOpacity(0.05),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
ranges.add(HorizontalRangeAnnotation(
|
|
|
|
|
y1:model.lowRefenceValue,
|
|
|
|
|
y2: model.highRefrenceValue,
|
|
|
|
|
color: AppColors.bgGreenColor.withOpacity(0.05),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
ranges.add(HorizontalRangeAnnotation(
|
|
|
|
|
y1:model.highRefrenceValue,
|
|
|
|
|
y2: model.maxY,
|
|
|
|
|
color: AppColors.criticalLowAndHigh.withOpacity(0.05),
|
|
|
|
|
));
|
|
|
|
|
return ranges;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget labHistoryList(LabViewModel labmodel) {
|
|
|
|
|
return SizedBox(
|
|
|
|
|
height: labmodel.filteredGraphValues.length<3?labmodel.filteredGraphValues.length*64:180.h,
|
|
|
|
|
|