WD: At risk added in the progress bar of vital signs

dev_v3.13.6_CS_V2
taha.alam 1 year ago
parent 48a0e0d949
commit 7b9bf68092

@ -33,8 +33,15 @@ class CustomResultProgressBar extends StatelessWidget {
final double percentage; final double percentage;
final String value; final String value;
final ResultTypes type; final ResultTypes type;
final bool showAtRisk;
const CustomResultProgressBar({Key? key, required this.percentage, required this.value, required this.type}) : super(key: key); const CustomResultProgressBar(
{Key? key,
required this.percentage,
required this.value,
required this.type,
this.showAtRisk = false})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -70,11 +77,15 @@ class CustomResultProgressBar extends StatelessWidget {
SizedBox( SizedBox(
width: spacing, width: spacing,
), ),
// _buildResultBar(
// flex: 2, Visibility(
// color: Color(0xFFEAB157), visible: showAtRisk,
// title: "High", child: _buildResultBar(
// ), flex: 2,
color: Color(0xFFE82626),
title: "At Risk",
),
),
// SizedBox( // SizedBox(
// width: spacing, // width: spacing,
// ), // ),
@ -92,7 +103,13 @@ class CustomResultProgressBar extends StatelessWidget {
children: [ children: [
TextCloud( TextCloud(
text: "${value}", text: "${value}",
color: percentage == 4 ? Color(0xFFDE7676) : percentage == 40 ? Color(0xff84d368) : Color(0xFF14a45f), color: percentage == 4
? Color(0xFFDE7676)
: percentage == 40
? Color(0xff84d368)
: percentage == 85
? Color(0xFFE82626)
: Color(0xFF14a45f),
// color: type == ResultTypes.criticalLow || type == ResultTypes.criticalHigh // color: type == ResultTypes.criticalLow || type == ResultTypes.criticalHigh
// ? Color(0xFFDE7676) // ? Color(0xFFDE7676)
// : type == ResultTypes.low || type == ResultTypes.high // : type == ResultTypes.low || type == ResultTypes.high
@ -263,6 +280,7 @@ class ItemResultCardWidgetWithParamsVitalSign extends StatelessWidget {
final String buttonText; final String buttonText;
final ResultTypes type; final ResultTypes type;
final bool isArabic; final bool isArabic;
final bool showAtRisk;
final Function()? onButtonPressed; final Function()? onButtonPressed;
const ItemResultCardWidgetWithParamsVitalSign({ const ItemResultCardWidgetWithParamsVitalSign({
@ -277,6 +295,7 @@ class ItemResultCardWidgetWithParamsVitalSign extends StatelessWidget {
required this.type, required this.type,
this.onButtonPressed, this.onButtonPressed,
this.isArabic = false, this.isArabic = false,
this.showAtRisk = false,
}) : super(key: key); }) : super(key: key);
@override @override
@ -372,7 +391,7 @@ class ItemResultCardWidgetWithParamsVitalSign extends StatelessWidget {
percentage: percentage, percentage: percentage,
value: subTitle, value: subTitle,
type: type, type: type,
), showAtRisk: showAtRisk),
), ),
// const SizedBox(height: 12), // const SizedBox(height: 12),
// Note Section // Note Section

@ -1,10 +1,7 @@
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/vital_signs/components/barWidget.dart'; import 'package:diplomaticquarterapp/vital_signs/components/barWidget.dart';
import 'package:diplomaticquarterapp/vital_signs/data/vitals_benchmark.dart'; import 'package:diplomaticquarterapp/vital_signs/data/vitals_benchmark.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class VitalSignWidget extends StatelessWidget { class VitalSignWidget extends StatelessWidget {
final String vitalSignName; final String vitalSignName;
@ -111,6 +108,7 @@ class VitalSignWidget extends StatelessWidget {
note: "Mayoclinic is the source of pediatrics value", note: "Mayoclinic is the source of pediatrics value",
source: "source", source: "source",
buttonText: "Click", buttonText: "Click",
showAtRisk: vitalName == 'bmi',
type: ResultTypes.criticalLow) type: ResultTypes.criticalLow)
// else if (condition is RangeConditionForBloodPressure) // else if (condition is RangeConditionForBloodPressure)
// Status( // Status(
@ -346,13 +344,18 @@ class VitalSignWidget extends StatelessWidget {
switch (interpretationValue) { switch (interpretationValue) {
case "poor": case "poor":
case "atRisk":
percent = 4; percent = 4;
case "good": case "good":
percent = 40; percent = 40;
case "excellent": case "excellent":
if (vitalName == 'bmi')
percent = 55;
else
percent = 75; percent = 75;
} }
if (interpretationValue == "atRisk" && vitalName == 'bmi') percent = 85;
return percent; return percent;
} }
@ -365,7 +368,7 @@ class VitalSignWidget extends StatelessWidget {
case "poor": case "poor":
return Color(0xFFDE7676); return Color(0xFFDE7676);
case "atRisk": case "atRisk":
return Color(0xFFa2494b); return Color(0xFFE82626);
} }
} }

@ -218,7 +218,7 @@ var vital = {
},{ },{
"min": 25, "min": 25,
"max": 30, "max": 30,
"interpretation": "poor", "interpretation": "good",
"quantitativeInterpretation": "normal", "quantitativeInterpretation": "normal",
"title": "25-30" "title": "25-30"
}, },

Loading…
Cancel
Save