Lab results designs enhancements

merge-requests/390/merge
Mirza.Shafique 4 years ago
parent 275b95be99
commit 717c7b3be4

@ -3,6 +3,7 @@ import 'dart:core';
import 'dart:io';
import 'dart:typed_data';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:badges/badges.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity/connectivity.dart';
@ -882,6 +883,30 @@ class Utils {
],
);
}
static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 14),
AutoSizeText(
isCapitable ? text.toLowerCase().capitalizeFirstofEach : text,
maxLines: 1,
minFontSize: 6,
style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12),
),
SizedBox(height: 10),
if (!isLast)
Divider(
height: 1,
color: Color(0xffEFEFEF),
thickness: 1,
)
],
);
}
}
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) {

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dar
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -45,23 +47,6 @@ class LabResultWidget extends StatelessWidget {
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.56, height: 21 / 14),
),
SizedBox(width: 16),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
),
),
);
},
child: Text(
TranslationBase.of(context).viewFlowChart,
style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12),
),
),
],
),
Table(
@ -69,6 +54,7 @@ class LabResultWidget extends StatelessWidget {
0: FlexColumnWidth(2),
1: FlexColumnWidth(1.5),
2: FlexColumnWidth(1),
3: FlexColumnWidth(1.7),
},
children: fullData(patientLabResultList, context),
),
@ -168,20 +154,53 @@ class LabResultWidget extends StatelessWidget {
Utils.tableColumnTitle(TranslationBase.of(context).description),
Utils.tableColumnTitle(TranslationBase.of(context).value),
Utils.tableColumnTitle(TranslationBase.of(context).range),
Utils.tableColumnTitle(""),
],
),
);
for (int i = 0; i < labResultList.length; i++)
for (int i = 0; i < labResultList.length; i++) {
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(labResultList[i].description, isLast: i == (labResultList.length - 1)),
Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: i == (labResultList.length - 1)),
Utils.tableColumnValue(labResultList[i].referanceRange, isLast: i == (labResultList.length - 1), isCapitable: false),
mHeight(8),
mHeight(8),
mHeight(8),
mHeight(8),
],
),
);
tableRow.add(
TableRow(
decoration: containerColorRadiusBorderWidth(Colors.grey[100], 12, Colors.grey[300], 0.6),
children: [
Padding(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0),
child: Utils.tableColumnValue(labResultList[i].description, isLast: true),
),
Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true),
Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
),
),
);
},
child: Padding(
padding: EdgeInsets.only(left: !projectViewModel.isArabic ? 0 : 12, right: !projectViewModel.isArabic ? 12 : 0),
child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false),
),
),
],
),
);
}
return tableRow;
}
}

Loading…
Cancel
Save