|
|
|
@ -6,18 +6,16 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
|
|
|
|
|
import '../../text.dart';
|
|
|
|
|
import 'FlowChartPage.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LabResultWidget extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
final String filterName ;
|
|
|
|
|
final String filterName;
|
|
|
|
|
final List<LabResult> patientLabResultList;
|
|
|
|
|
final PatientLabOrders patientLabOrder;
|
|
|
|
|
|
|
|
|
|
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key);
|
|
|
|
|
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key);
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -28,11 +26,14 @@ class LabResultWidget extends StatelessWidget {
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(height: 8),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(filterName),
|
|
|
|
|
Text(
|
|
|
|
|
filterName,
|
|
|
|
|
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.56, height: 21 / 14),
|
|
|
|
|
),SizedBox(width: 16),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
@ -40,135 +41,94 @@ class LabResultWidget extends StatelessWidget {
|
|
|
|
|
FadePage(
|
|
|
|
|
page: FlowChartPage(
|
|
|
|
|
filterName: filterName,
|
|
|
|
|
patientLabOrder: patientLabOrder,
|
|
|
|
|
patientLabOrder: patientLabOrder,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).showMoreBtn,
|
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
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(
|
|
|
|
|
border: TableBorder.symmetric(
|
|
|
|
|
inside: BorderSide(
|
|
|
|
|
width: 2.0, color: Colors.grey[300]),
|
|
|
|
|
),
|
|
|
|
|
children: fullData(patientLabResultList,context),
|
|
|
|
|
columnWidths: {
|
|
|
|
|
0: FlexColumnWidth(2),
|
|
|
|
|
1: FlexColumnWidth(1.5),
|
|
|
|
|
2: FlexColumnWidth(1),
|
|
|
|
|
},
|
|
|
|
|
children: fullData(patientLabResultList, context),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
List<TableRow> fullData(List<LabResult> labResultList,context) {
|
|
|
|
|
|
|
|
|
|
List<TableRow> fullData(List<LabResult> labResultList, context) {
|
|
|
|
|
List<TableRow> tableRow = [];
|
|
|
|
|
tableRow.add(
|
|
|
|
|
TableRow(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: projectViewModel.isArabic
|
|
|
|
|
? Radius.circular(0.0)
|
|
|
|
|
: Radius.circular(10.0),
|
|
|
|
|
topRight: projectViewModel.isArabic
|
|
|
|
|
? Radius.circular(10.0)
|
|
|
|
|
: Radius.circular(0.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).description,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
height: 60,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(TranslationBase.of(context).value, color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
height: 60),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: projectViewModel.isArabic
|
|
|
|
|
? Radius.circular(10.0)
|
|
|
|
|
: Radius.circular(0.0),
|
|
|
|
|
topRight: projectViewModel.isArabic
|
|
|
|
|
? Radius.circular(0.0)
|
|
|
|
|
: Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(TranslationBase.of(context).range, color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
height: 60),
|
|
|
|
|
),
|
|
|
|
|
_tableColumnTitle(TranslationBase.of(context).description),
|
|
|
|
|
_tableColumnTitle(TranslationBase.of(context).value),
|
|
|
|
|
_tableColumnTitle(TranslationBase.of(context).range),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
labResultList.forEach((lab) {
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < labResultList.length; i++)
|
|
|
|
|
tableRow.add(
|
|
|
|
|
TableRow(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(
|
|
|
|
|
lab.description,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(
|
|
|
|
|
lab.resultValue+" "+lab.uOM,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(
|
|
|
|
|
lab.referanceRange,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
_tableColumnValue(labResultList[i].description, isLast: i == (labResultList.length - 1)),
|
|
|
|
|
_tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: i == (labResultList.length - 1)),
|
|
|
|
|
_tableColumnValue(labResultList[i].referanceRange, isLast: i == (labResultList.length - 1)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
return tableRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _tableColumnTitle(String text) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(height: 6),
|
|
|
|
|
Text(
|
|
|
|
|
text,
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 6),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
thickness: 1,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _tableColumnValue(String text, {bool isLast = false}) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
Text(
|
|
|
|
|
text.toLowerCase().capitalizeFirstofEach,
|
|
|
|
|
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 12),
|
|
|
|
|
if (!isLast)
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: Color(0xffEFEFEF),
|
|
|
|
|
thickness: 1,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|