|
|
|
@ -1,14 +1,20 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.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/network_base_view.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
class MedicalFilePage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
@ -20,6 +26,10 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
|
String patientType = routeArgs['patientType'];
|
|
|
|
|
String arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
|
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
|
return BaseView<MedicalFileViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
|
|
|
|
@ -32,19 +42,91 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Column(
|
|
|
|
|
// mainAxisAlignment: model.medicalFileList.length != 0 &&
|
|
|
|
|
// model.medicalFileList != null
|
|
|
|
|
// ? MainAxisAlignment.start
|
|
|
|
|
// : MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
PatientPageHeaderWidget(patient),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0),
|
|
|
|
|
child: Row(children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Colors.black, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
(Helpers.capitalize(patient.firstName) +
|
|
|
|
|
" " +
|
|
|
|
|
Helpers.capitalize(patient.lastName)),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 3,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
backGroundcolor: Colors.white,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
patient.gender == 1
|
|
|
|
|
? Icon(
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
)
|
|
|
|
|
: Icon(
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Row(children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 12.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 60,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
patient.gender == 1
|
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
|
|
: 'assets/images/female_avatar.png',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1.0,
|
|
|
|
|
thickness: 1.0,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
'Medical',
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
'Report',
|
|
|
|
|
fontSize: 35.0,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
(model.medicalFileList != null &&
|
|
|
|
|
model.medicalFileList.length != 0)
|
|
|
|
|
? ListView.builder(
|
|
|
|
@ -60,66 +142,208 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
|
|
|
|
|
horizontal: 12.0, vertical: 8.0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 10, left: 10, right: 10),
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.grey[200], width: 0.5),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).branch +
|
|
|
|
|
": ",
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.doctorName,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 17.0,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppText(model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.projectName),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
Helpers.convertStringToDate(model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.date)
|
|
|
|
|
.day
|
|
|
|
|
.toString() +
|
|
|
|
|
"/",
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
Helpers.convertStringToDate(model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.date)
|
|
|
|
|
.month
|
|
|
|
|
.toString() +
|
|
|
|
|
"/",
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
Helpers.convertStringToDate(
|
|
|
|
|
model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.date)
|
|
|
|
|
.year
|
|
|
|
|
.toString(),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.doctorName
|
|
|
|
|
.toUpperCase() +
|
|
|
|
|
": ",
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: AppText(
|
|
|
|
|
model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.doctorName,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
ClipRRect(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(
|
|
|
|
|
Radius.circular(30)),
|
|
|
|
|
child: Image.network(
|
|
|
|
|
'https://media.istockphoto.com/photos/portrait-senior-asian-doctor-over-radiography-background-asian-picture-id1019862020?k=6&m=1019862020&s=612x612&w=0&h=40frRnNnEGhNv5XRcDMRn55bIxCC3oXzbO6pOSQL_sQ=',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 70,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.clinic +
|
|
|
|
|
": ",
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.clinicName,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.branch +
|
|
|
|
|
": ",
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.projectName,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.clinicName +
|
|
|
|
|
": ",
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
model
|
|
|
|
|
.medicalFileList[0]
|
|
|
|
|
.entityList[0]
|
|
|
|
|
.timelines[index]
|
|
|
|
|
.clinicName,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.remove_red_eye,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 10.0),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1.0,
|
|
|
|
|
thickness: 1.0,
|
|
|
|
|
color: Colors.grey.shade400,
|
|
|
|
|
)
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// model
|
|
|
|
|
// .medicalFileList[0]
|
|
|
|
|
// .entityList[0]
|
|
|
|
|
// .timelines[index]
|
|
|
|
|
// .doctorName,
|
|
|
|
|
// fontWeight: FontWeight.w700,
|
|
|
|
|
// fontSize: 18.0,
|
|
|
|
|
// fontFamily: 'Poppins',
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context).branch +
|
|
|
|
|
// ": ",
|
|
|
|
|
// fontWeight: FontWeight.w700,
|
|
|
|
|
// ),
|
|
|
|
|
// AppText(model
|
|
|
|
|
// .medicalFileList[0]
|
|
|
|
|
// .entityList[0]
|
|
|
|
|
// .timelines[index]
|
|
|
|
|
// .projectName),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .clinicName +
|
|
|
|
|
// ": ",
|
|
|
|
|
// fontWeight: FontWeight.w700,
|
|
|
|
|
// ),
|
|
|
|
|
// AppText(
|
|
|
|
|
// model
|
|
|
|
|
// .medicalFileList[0]
|
|
|
|
|
// .entityList[0]
|
|
|
|
|
// .timelines[index]
|
|
|
|
|
// .clinicName,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 10.0),
|
|
|
|
|
// Divider(
|
|
|
|
|
// height: 1.0,
|
|
|
|
|
// thickness: 1.0,
|
|
|
|
|
// color: Colors.grey.shade400,
|
|
|
|
|
// )
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|