You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RSGDoctorApp/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart

164 lines
7.3 KiB
Dart

import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
class LabResultHistoryPage extends StatelessWidget {
final PatientLabOrders patientLabOrder;
final String filterName;
final PatiantInformtion patient;
LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient});
// TODO Elham* UI changes and add translation
@override
Widget build(BuildContext context) {
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResultHistoryByDescription(
patientLabOrder: patientLabOrder,
procedureDescription: filterName,
patient: patient),
builder: (context, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: filterName,
baseViewModel: model,
body: model.labOrdersResultHistoryList.length > 0
? SingleChildScrollView(
child: Column(
children: [
...List.generate(model.labOrdersResultHistoryList.length,
(index) {
return Container(
margin: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 16.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).description,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index]
.description,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Reference Range",
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index]
.referanceRange,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Result Value",
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index]
.resultValue,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Verified On",
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index]
.verifiedOn,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
SizedBox(
height: 10,
),
],
),
);
}),
],
),
)
: ErrorMessage(
error: "No data",
),
),
);
}
}