|
|
|
|
@ -74,12 +74,20 @@ class VitalSignWidget extends StatelessWidget {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
if(lookupValues!= null)
|
|
|
|
|
Status(
|
|
|
|
|
if (condition is RangeConditionWithTitle)
|
|
|
|
|
Status(
|
|
|
|
|
status:
|
|
|
|
|
"${TranslationBase.of(context).getValue(condition.current?.quantitativeInterpretation ?? '')}",
|
|
|
|
|
originalData: condition.current?.quantitativeInterpretation??'',
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
else if (condition is RangeConditionForBloodPressure)
|
|
|
|
|
Status(
|
|
|
|
|
status:
|
|
|
|
|
"${TranslationBase.of(context).getValue(condition.systolic?.systolic.quantitativeInterpretation ?? '')}",
|
|
|
|
|
originalData: condition
|
|
|
|
|
.systolic?.systolic.quantitativeInterpretation ??
|
|
|
|
|
'',
|
|
|
|
|
)
|
|
|
|
|
// Text(
|
|
|
|
|
// "${TranslationBase.of(context).getValue(condition.current?.quantitativeInterpretation ?? '')}",
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
@ -96,87 +104,169 @@ class VitalSignWidget extends StatelessWidget {
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 30,
|
|
|
|
|
// child: Row(mainAxisSize: MainAxisSize.max, children: [
|
|
|
|
|
if (lookupValues != null)
|
|
|
|
|
Flexible(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: lookupValues?.length ?? 0,
|
|
|
|
|
itemBuilder: (_, index) {
|
|
|
|
|
var key = lookupValues?.keys.elementAt(index);
|
|
|
|
|
return RangeWidget(
|
|
|
|
|
title: key ?? '',
|
|
|
|
|
values: lookupValues?[key] ?? [],
|
|
|
|
|
isSelected: false,
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
if (condition is RangeConditionWithTitle)
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
child: Row(mainAxisSize: MainAxisSize.max, children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: condition.condition?.length ?? 0,
|
|
|
|
|
itemBuilder: (_, index) => RangeWidget(
|
|
|
|
|
title: condition.condition?[index].title ?? 'test',
|
|
|
|
|
isSelected: condition.condition?[index]
|
|
|
|
|
.isInRange(vitalSignValue) ==
|
|
|
|
|
true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
// Flexible(
|
|
|
|
|
// flex: 1,
|
|
|
|
|
// child: ListView.separated(
|
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
// separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
// width: 8,
|
|
|
|
|
// ),
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
// itemCount: lookupValues?.length ?? 0,
|
|
|
|
|
// itemBuilder: (_, index) {
|
|
|
|
|
// var key = lookupValues?.keys.elementAt(index);
|
|
|
|
|
// return RangeWidget(
|
|
|
|
|
// title: key ?? '',
|
|
|
|
|
// values: lookupValues?[key] ?? [],
|
|
|
|
|
// isSelected: false,
|
|
|
|
|
// );
|
|
|
|
|
// }),
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
if (bloodPressureValues != null)
|
|
|
|
|
Flexible(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: bloodPressureValues?.length ?? 0,
|
|
|
|
|
itemBuilder: (_, index) {
|
|
|
|
|
|
|
|
|
|
var key = bloodPressureValues?.keys.elementAt(index);
|
|
|
|
|
print('the ssize is ${ (bloodPressureValues?[key]?.length??1)*40} ');
|
|
|
|
|
// return RangeWidget(
|
|
|
|
|
// title: key??'',
|
|
|
|
|
// values: lookupValues?[key]??[],isSelected: false,
|
|
|
|
|
// );
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).getValue(key ?? ''),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style:
|
|
|
|
|
TextStyle(color: Colors.black, fontSize: 16),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Status(
|
|
|
|
|
status:
|
|
|
|
|
"${TranslationBase.of(context).getValue(condition.getValue(key)?.quantitativeInterpretation ?? '')}",
|
|
|
|
|
originalData:condition.getValue(key)?.quantitativeInterpretation ?? '' ,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height:220,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: bloodPressureValues?[key]?.length ?? 0,
|
|
|
|
|
itemBuilder: (_, index) {
|
|
|
|
|
var title = bloodPressureValues?[key]?.keys.elementAt(index);
|
|
|
|
|
|
|
|
|
|
return RangeWidget(
|
|
|
|
|
title: title ?? '',
|
|
|
|
|
values: bloodPressureValues?[key]?[title] ?? [],
|
|
|
|
|
isSelected: false,
|
|
|
|
|
);
|
|
|
|
|
}))
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
if (condition is RangeConditionForBloodPressure)
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
child: Row(mainAxisSize: MainAxisSize.max, children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: condition.condition?.length ?? 0,
|
|
|
|
|
itemBuilder: (_, currentIndex) {
|
|
|
|
|
var title =
|
|
|
|
|
condition.condition?[currentIndex].quotient ??
|
|
|
|
|
'';
|
|
|
|
|
return RangeWidget(
|
|
|
|
|
title: title,
|
|
|
|
|
isSelected: condition.condition?[currentIndex]
|
|
|
|
|
?.getValue("systolic-lng")
|
|
|
|
|
?.isSelected ==
|
|
|
|
|
true,
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
// ]),
|
|
|
|
|
// Flexible(
|
|
|
|
|
// flex: 1,
|
|
|
|
|
// child: ListView.separated(
|
|
|
|
|
// separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
// width: 8,
|
|
|
|
|
// ),
|
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
// itemCount: bloodPressure.length ?? 0,
|
|
|
|
|
// itemBuilder: (_, index) {
|
|
|
|
|
// // return RangeWidget(
|
|
|
|
|
// // title: key??'',
|
|
|
|
|
// // values: lookupValues?[key]??[],isSelected: false,
|
|
|
|
|
// // );
|
|
|
|
|
// return Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .getValue(bloodPressure[index] ?? ''),
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
// style:
|
|
|
|
|
// TextStyle(color: Colors.black, fontSize: 16),
|
|
|
|
|
// ),
|
|
|
|
|
//
|
|
|
|
|
// Status(
|
|
|
|
|
// status:
|
|
|
|
|
// "${TranslationBase.of(context).getValue(condition.getValue(bloodPressure[index])?.quantitativeInterpretation ?? '')}",
|
|
|
|
|
// originalData:condition.getValue(bloodPressure[index])?.quantitativeInterpretation ?? '' ,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 16),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 30,
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisSize: MainAxisSize.max,
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 1,
|
|
|
|
|
// child: ListView.separated(
|
|
|
|
|
// separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
// width: 8,
|
|
|
|
|
// ),
|
|
|
|
|
// scrollDirection: Axis.horizontal,
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
// itemCount:
|
|
|
|
|
// condition.condition?.length ?? 0,
|
|
|
|
|
// itemBuilder: (_, currentIndex) {
|
|
|
|
|
// var title = condition
|
|
|
|
|
// .condition?[currentIndex]
|
|
|
|
|
// .getValue(
|
|
|
|
|
// bloodPressure[index]).title ??
|
|
|
|
|
// '';
|
|
|
|
|
// return RangeWidget(
|
|
|
|
|
// title: title,
|
|
|
|
|
// isSelected: condition
|
|
|
|
|
// .condition?[currentIndex]
|
|
|
|
|
// ?.getValue(
|
|
|
|
|
// bloodPressure[index])
|
|
|
|
|
// ?.isSelected ==
|
|
|
|
|
// true,
|
|
|
|
|
// );
|
|
|
|
|
// }),
|
|
|
|
|
// ),
|
|
|
|
|
// ]),
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 16),
|
|
|
|
|
// // SizedBox(
|
|
|
|
|
// // height:220,
|
|
|
|
|
// // child: ListView.separated(
|
|
|
|
|
// // separatorBuilder: (_, __) => SizedBox(
|
|
|
|
|
// // width: 8,
|
|
|
|
|
// // ),
|
|
|
|
|
// // physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
// // shrinkWrap: true,
|
|
|
|
|
// // itemCount: bloodPressureValues?[key]?.length ?? 0,
|
|
|
|
|
// // itemBuilder: (_, index) {
|
|
|
|
|
// // var title = bloodPressureValues?[key]?.keys.elementAt(index);
|
|
|
|
|
// //
|
|
|
|
|
// // return RangeWidget(
|
|
|
|
|
// // title: title ?? '',
|
|
|
|
|
// // values: bloodPressureValues?[key]?[title] ?? [],
|
|
|
|
|
// // isSelected: false,
|
|
|
|
|
// // );
|
|
|
|
|
// // }))
|
|
|
|
|
// ],
|
|
|
|
|
// );
|
|
|
|
|
// }),
|
|
|
|
|
// ),
|
|
|
|
|
// ]),
|
|
|
|
|
// ),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
@ -215,78 +305,34 @@ class VitalSignWidget extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
class RangeWidget extends StatelessWidget {
|
|
|
|
|
final String title;
|
|
|
|
|
final List<String> values;
|
|
|
|
|
final bool isSelected;
|
|
|
|
|
|
|
|
|
|
const RangeWidget(
|
|
|
|
|
{super.key,
|
|
|
|
|
required this.title,
|
|
|
|
|
required this.isSelected,
|
|
|
|
|
required this.values});
|
|
|
|
|
const RangeWidget({super.key, required this.title, required this.isSelected});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
child: Material(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadiusDirectional.only(
|
|
|
|
|
topStart: Radius.circular(8),
|
|
|
|
|
bottomStart: Radius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// color: Color(0xFF359846),
|
|
|
|
|
color: CustomColors.lightGreyColor,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top:4.0, bottom :4, right: 8, left: 8),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).getValue(title),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(color: Colors.black, fontSize: 12),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
return SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
child: Material(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(3),
|
|
|
|
|
),
|
|
|
|
|
// color: Color(0xFF359846),
|
|
|
|
|
color: (isSelected)
|
|
|
|
|
? CustomColors.accentColor
|
|
|
|
|
: CustomColors.lightGreyColor,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
title,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: (isSelected) ? Colors.white : Colors.black,
|
|
|
|
|
fontSize: 12),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Material(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadiusDirectional.only(
|
|
|
|
|
topEnd: Radius.circular(8),
|
|
|
|
|
bottomEnd: Radius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// color: Color(0xFF359846),
|
|
|
|
|
color: getColor(title),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 30,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: List.generate(
|
|
|
|
|
values.length,
|
|
|
|
|
(index) => Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
values[index],
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(color: Colors.white, fontSize: 12),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|