import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/FlowChartPage.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LabResultWidget extends StatelessWidget { final List patientLabResultList; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; LabResultWidget({Key key, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); return Container( width: double.infinity, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Expanded( child: Container( child: Center( child: Texts( TranslationBase.of(context).description, color: Colors.black,bold: true, ), ), ), ), Expanded( child: Container( child: Center( child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), ), ), ), Expanded( child: Container( child: Center( child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), ), ), ) ], ), SizedBox(height: 7,), Divider(color: Colors.black,thickness: 1,), SizedBox(height: 12,), ...List.generate(patientLabResultList.length, (index) => Column( children: [ Row( children: [ Expanded( child: Container( padding: EdgeInsets.all(10), color: Colors.white, child: Center( child: Texts( '${patientLabResultList[index].testCode}\n'+ patientLabResultList[index].description, textAlign: TextAlign.center, ), ), ), ), Expanded( child: Container( padding: EdgeInsets.all(10), color: Colors.white, child: Center( child: Texts( patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM, textAlign: TextAlign.center, ), ), ), ), Expanded( child: Container( padding: EdgeInsets.all(10), color: Colors.white, child: Center( child: Texts( patientLabResultList[index].referanceRange, textAlign: TextAlign.center, ), ), ), ) ], ), Divider(), ], )) // Table( // border: TableBorder.symmetric( // inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid), // ), // children: fullData(patientLabResultList,context), // ), ], ), ); } List fullData(List labResultList,context) { List tableRow = []; tableRow.add( TableRow( children: [ Container( child: Center( child: Texts( TranslationBase.of(context).description, color: Colors.black,bold: true, ), ), ), Container( child: Center( child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), ), ), Container( child: Center( child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), ), ), ], ), ); labResultList.forEach((lab) { 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, ), ), ), ), ], ), ); }); return tableRow; } }