test description issue in lab results fixed

pull/190/head
Haroon Amjad 3 months ago
parent dc0e4e5eb6
commit c2028841c5

@ -27,6 +27,7 @@ class LabResult {
num? resultTypeID; num? resultTypeID;
String? packageShortDescription; String? packageShortDescription;
int? testId; int? testId;
String? testShortDescription;
LabResult( LabResult(
{this.description, {this.description,
@ -54,6 +55,7 @@ class LabResult {
this.criticalLow, this.criticalLow,
this.referenceLow, this.referenceLow,
this.testId, this.testId,
this.testShortDescription,
}); });
LabResult.fromJson(Map<String, dynamic> json) { LabResult.fromJson(Map<String, dynamic> json) {
@ -85,6 +87,7 @@ class LabResult {
packageShortDescription = json['PackageShortDescription']; packageShortDescription = json['PackageShortDescription'];
resultTypeID = json['ResultTypeID']; resultTypeID = json['ResultTypeID'];
testId = json['TestID']; testId = json['TestID'];
testShortDescription = json['TestShortDescription'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -114,6 +117,7 @@ class LabResult {
data['CriticalLow'] = this.criticalLow; data['CriticalLow'] = this.criticalLow;
data['ReferenceLow'] = this.referenceLow; data['ReferenceLow'] = this.referenceLow;
data['TestID'] = this.testId; data['TestID'] = this.testId;
data['TestShortDescription'] = this.testShortDescription;
return data; return data;
} }

@ -22,7 +22,7 @@ class LabOrderResultItem extends StatelessWidget {
final bool isExpanded; final bool isExpanded;
final Color iconColor; final Color iconColor;
const LabOrderResultItem({super.key, required this.onTap, this.tests, required this.index, this.isLoading = false, this.isExpanded = false,required this.iconColor, required this.severityText}); const LabOrderResultItem({super.key, required this.onTap, this.tests, required this.index, this.isLoading = false, this.isExpanded = false, required this.iconColor, required this.severityText});
@override @override
build(BuildContext context) { build(BuildContext context) {
@ -42,7 +42,10 @@ class LabOrderResultItem extends StatelessWidget {
padding: EdgeInsets.only(bottom: 8.h), padding: EdgeInsets.only(bottom: 8.h),
child: '${tests!.description}'.toText14(weight: FontWeight.w500), child: '${tests!.description}'.toText14(weight: FontWeight.w500),
), ),
(tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), // (tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
((tests!.testShortDescription != null && tests!.testShortDescription!.isNotEmpty) ? tests!.testShortDescription : tests!.packageShortDescription)!
.toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
SizedBox(height: 12.h), SizedBox(height: 12.h),
Directionality( Directionality(
textDirection: ui.TextDirection.ltr, textDirection: ui.TextDirection.ltr,
@ -65,28 +68,30 @@ class LabOrderResultItem extends StatelessWidget {
), ),
), ),
), ),
SizedBox(width: 4.h,), SizedBox(
width: 4.h,
),
Visibility( Visibility(
// visible: tests?.checkIfGraphShouldBeDisplayed() == true, // visible: tests?.checkIfGraphShouldBeDisplayed() == true,
visible: true, visible: true,
child: Expanded( child: Expanded(
flex: 2, flex: 2,
child: Visibility( child: Visibility(
visible: tests?.referanceRange != null, visible: tests?.referanceRange != null,
child: Text( child: Text(
"(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})", "(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})",
style: TextStyle( style: TextStyle(
fontSize: 12.f, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppColors.greyTextColor, color: AppColors.greyTextColor,
),
// overflow: TextOverflow.ellipsis,
// maxLines: 2,
softWrap: true,
), ),
// overflow: TextOverflow.ellipsis,
// maxLines: 2,
softWrap: true,
), ),
), ),
),
) )
], ],
), ),
@ -102,14 +107,8 @@ class LabOrderResultItem extends StatelessWidget {
spacing: 6.h, spacing: 6.h,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
severityText.tr().toText10( severityText.tr().toText10(weight: FontWeight.w500, color: AppColors.greyTextColor),
weight: FontWeight.w500, Utils.buildSvgWithAssets(icon: AppAssets.lab_result_indicator, width: 21, height: 23, iconColor: iconColor),
color: AppColors.greyTextColor),
Utils.buildSvgWithAssets(
icon: AppAssets.lab_result_indicator,
width: 21,
height: 23,
iconColor: iconColor),
], ],
), ),
), ),
@ -119,7 +118,7 @@ class LabOrderResultItem extends StatelessWidget {
iconSize: 16.h, iconSize: 16.h,
text: LocaleKeys.viewReport.tr(context: context), text: LocaleKeys.viewReport.tr(context: context),
onPressed: () { onPressed: () {
onTap(); onTap();
}, },
backgroundColor: AppColors.secondaryLightRedColor, backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor,

Loading…
Cancel
Save