From 16821c17fc4fc92f086723a2e4638225b40a62cd Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 14 Dec 2020 09:27:52 +0200 Subject: [PATCH 1/3] re-design in-patient detail page --- lib/config/localized_values.dart | 24 +- lib/util/date-utils.dart | 77 ++++ lib/util/translations_delegate_base.dart | 32 +- .../profile/patient_profile_widget.dart | 432 ++++++++++++++++-- .../profile/profile_medical_info_widget.dart | 59 ++- 5 files changed, 558 insertions(+), 66 deletions(-) create mode 100644 lib/util/date-utils.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0b176b65..0dee26b9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -34,18 +34,22 @@ const Map> localizedValues = { 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'patient': {'en': 'Patient', 'ar': ' مريض'}, 'labResult': {'en': 'Lab Result', 'ar': 'نتيجة المختبر'}, + 'lab': {'en': 'Lab', 'ar': 'المختبر'}, + 'result': {'en': 'Result', 'ar': 'نتيجة'}, 'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'}, 'arrived': {'en': 'Arrived', 'ar': 'وصل'}, 'er': {'en': 'ER', 'ar': 'حالة طوارئ'}, 'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'}, 'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, + 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'االإحالة'}, 'inPatient': {'en': 'In-Patient', 'ar': 'االمريض الداخلي'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, + 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'}, @@ -78,9 +82,14 @@ const Map> localizedValues = { 'errorMessage': {'en': 'Something went wrong', 'ar': 'حدث خطأ ما'}, 'patientProfile': {'en': 'Patient Profile', 'ar': 'ملف المريض'}, 'vitalSign': {'en': 'Vital Sign', 'ar': 'المؤشرات الحيوية'}, + 'vital': {'en': 'Vital', 'ar': 'الحيوية'}, + 'signs': {'en': 'Signs', 'ar': 'المؤشرات'}, 'labOrder': {'en': 'Lab Order', 'ar': 'نتائج التحاليل'}, - 'prescription': {'en': 'Prescription', 'ar': 'الوصفات'}, + 'medicines': {'en': 'Medicines', 'ar': 'الأدوية'}, + 'prescription': {'en': 'Prescription', 'ar': 'وصفات'}, 'insuranceApprovals': {'en': 'Insurance Approvals', 'ar': 'موافقات التأمين'}, + 'insurance': {'en': 'Insurance', 'ar': 'التأمين'}, + 'approvals': {'en': 'Approvals', 'ar': 'موافقات'}, 'bodyMeasurements': {'en': 'Body Measurements', 'ar': 'قياسات الجسم'}, 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, @@ -104,6 +113,8 @@ const Map> localizedValues = { }, 'replay': {'en': 'Replay', 'ar': 'تاكيد'}, 'progressNote': {'en': 'Progress Note', 'ar': 'ملاحظة التقدم'}, + 'progress': {'en': 'Progress', 'ar': 'التقدم'}, + 'note': {'en': 'Note', 'ar': 'ملاحظة'}, 'searchNote': {'en': 'Search Note', 'ar': 'بحث عن ملاحظة'}, 'errorNoProgressNote': { 'en': 'You don\'t have any Progress Note', @@ -164,6 +175,7 @@ const Map> localizedValues = { 'ar': 'ليس لديك اي مرضى' }, 'age': {'en': 'Age', 'ar': 'العمر'}, + 'nationality': {'en': 'Nationality', 'ar': 'الجنسية'}, 'today': {'en': 'Today', 'ar': 'اليوم'}, 'yesterday': {'en': 'Yesterday', 'ar': 'الأمس'}, 'tomorrow': {'en': 'Tomorrow', 'ar': 'الغد'}, @@ -204,7 +216,8 @@ const Map> localizedValues = { 'price': {'en': 'Price', 'ar': 'السعر'}, 'youCanFindItIn': {'en': 'You can Find it in', 'ar': 'تستطيع ان تجده هنا '}, 'radiologyReport': {'en': 'Radiology Report', 'ar': 'تقرير الاشعة'}, - 'orders': {'en': 'Orders', 'ar': ' الطلبات'}, + 'orders': {'en': 'Orders', 'ar': 'الطلبات'}, + 'list': {'en': 'List', 'ar': 'قائمة'}, 'searchOrders': {'en': 'Search Orders', 'ar': ' بحث عن الطلبات'}, 'prescriptionDetails': {'en': 'Prescription Details', 'ar': 'تفاصبل الوصفة'}, 'prescriptionInfo': {'en': 'Prescription Info', 'ar': 'معلومات الوصفة'}, @@ -253,4 +266,11 @@ const Map> localizedValues = { 'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح' }, + 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, + 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, + 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, + 'losNo': {'en': 'LOS #:', 'ar': 'LOS #:'}, + 'area': {'en': 'AREA:', 'ar': 'المنطقة'}, + 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, + 'bed': {'en': 'BED:', 'ar': 'السرير'}, }; diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart new file mode 100644 index 00000000..f0f03ed8 --- /dev/null +++ b/lib/util/date-utils.dart @@ -0,0 +1,77 @@ +import 'package:intl/intl.dart'; + +class DateUtils { + + static String convertStringToDateFormat(String date, String dateFormat) { + DateTime dateTime = DateTime.parse(date); + return DateFormat(dateFormat).format(dateTime); + } + + static convertDateFromServerFormat(String str, dateFormat) { + const start = "/Date("; + + const end = "+0300)"; + + final startIndex = str.indexOf(start); + + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + + return DateFormat(dateFormat).format(date); + } + + static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate) { + DateTime now = DateTime.now(); + // now = now.add(Duration(days: 400, minutes: 0)); + var difference = firstDate.difference(now); + + int years = now.year - firstDate.year; + int months = now.month - firstDate.month; + int days = now.day - firstDate.day; + + if (months < 0 || (months == 0 && days < 0)) { + years--; + months += (days < 0 ? 11 : 12); + } + if (days < 0) { + final monthAgo = new DateTime(now.year, now.month - 1, firstDate.day); + days = now.difference(monthAgo).inDays + 1; + } + + + return "$days Days, $months Months, $years Years"; + } + + static String differenceBetweenDateAndCurrent(DateTime firstDate) { + DateTime now = DateTime.now(); + // DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0)); + var difference = now.difference(firstDate); + + int minutesInDays = difference.inMinutes; + int hoursInDays = minutesInDays ~/ 60; + int minutes = minutesInDays % 60; + int days = hoursInDays ~/ 24; + int hours = hoursInDays % 24; + + double hoursInOneDay = difference.inHours / difference.inDays; + + return "$days Days, $hours HR, $minutes Min"; + } + + static String differenceBetweenServerDateAndCurrent(String str) { + const start = "/Date("; + + const end = "+0300)"; + + final startIndex = str.indexOf(start); + + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + return differenceBetweenDateAndCurrent(date); + } +} + diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1eabaea8..3bea8990 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -71,6 +71,7 @@ class TranslationBase { String get walkIn => localizedValues['walkIn'][locale.languageCode]; String get notArrived => localizedValues['notArrived'][locale.languageCode]; String get radiology => localizedValues['radiology'][locale.languageCode]; + String get service => localizedValues['service'][locale.languageCode]; String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; String get operations => localizedValues['operations'][locale.languageCode]; @@ -78,8 +79,8 @@ class TranslationBase { localizedValues['patientServices'][locale.languageCode]; String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferral => localizedValues['myReferral'][locale.languageCode]; String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; @@ -112,11 +113,16 @@ class TranslationBase { String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String get vital => localizedValues['vital'][locale.languageCode]; + String get signs => localizedValues['signs'][locale.languageCode]; String get labOrder => localizedValues['labOrder'][locale.languageCode]; - String get prescription => - localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals'][locale.languageCode]; + String get lab => localizedValues['lab'][locale.languageCode]; + String get result => localizedValues['result'][locale.languageCode]; + String get medicines => localizedValues['medicines'][locale.languageCode]; + String get prescription => localizedValues['prescription'][locale.languageCode]; + String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get insurance => localizedValues['insurance'][locale.languageCode]; + String get approvals => localizedValues['approvals'][locale.languageCode]; String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -136,8 +142,9 @@ class TranslationBase { String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => - localizedValues['progressNote'][locale.languageCode]; + String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get progress => localizedValues['progress'][locale.languageCode]; + String get note => localizedValues['note'][locale.languageCode]; String get searchNote => localizedValues['searchNote'][locale.languageCode]; String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; @@ -191,6 +198,7 @@ class TranslationBase { String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; String get age => localizedValues['age'][locale.languageCode]; + String get nationality => localizedValues['nationality'][locale.languageCode]; String get today => localizedValues['today'][locale.languageCode]; String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; String get all => localizedValues['all'][locale.languageCode]; @@ -229,6 +237,7 @@ class TranslationBase { String get radiologyReport => localizedValues['radiologyReport'][locale.languageCode]; String get orders => localizedValues['orders'][locale.languageCode]; + String get list => localizedValues['list'][locale.languageCode]; String get searchOrders => localizedValues['searchOrders'][locale.languageCode]; String get prescriptionDetails => @@ -277,6 +286,13 @@ class TranslationBase { localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode]; + String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; + String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String get losNo => localizedValues['losNo'][locale.languageCode]; + String get area => localizedValues['area'][locale.languageCode]; + String get room => localizedValues['room'][locale.languageCode]; + String get bed => localizedValues['bed'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 056d0be5..22885baa 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -1,7 +1,12 @@ +import 'package:doctor_app_flutter/config/size_config.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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; import './profile_medical_info_widget.dart'; /* @@ -19,54 +24,401 @@ class PatientProfileWidget extends StatelessWidget { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; - return CustomScrollView(primary: false, slivers: [ - SliverList( - delegate: SliverChildListDelegate( - [ - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Column(children: [ - Container( - padding: EdgeInsets.only(top: 20), - child: ProfileImageWidget( - url: - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", - name: patient.firstName + ' ' + patient.lastName, - fontsize: 24.0, - color: Colors.black, + return Container( + color: Color(0XFFF2F2F2), + child: CustomScrollView(primary: false, slivers: [ + SliverList( + delegate: SliverChildListDelegate( + [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.shade300, + blurRadius: 10.0, + spreadRadius: 0, + offset: Offset(0, 10) + ), + ], + color: Colors.white + ), + child: Column(children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 20, + ), + AppText( + patient.patientId.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ) + ], + ) + ], ), ), Container( - child: Column( - children: [ - AppText( - 'File No: ' + patient.patientId.toString(), - fontWeight: FontWeight.normal, - fontSize: 16, + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + height: 10 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + fontWeight: FontWeight.bold, + fontSize: 2 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${patient.age}", + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).nationality, + fontWeight: FontWeight.bold, + fontSize: 2 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.nationalityName, + fontWeight: FontWeight.normal, + fontSize: 1.7 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).gender, + fontWeight: FontWeight.bold, + fontSize: 2 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.genderDescription, + fontWeight: FontWeight.normal, + fontSize: 1.8 * SizeConfig.textMultiplier, + ), + ], + ), + ), ), - AppText( - patient.genderDescription.toString() + - ', ' + - patient.age, - fontWeight: FontWeight.normal, - fontSize: 16, - ) ], ), - ) + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), ]), - ]), - ), - ], + ), + Container( + margin: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).admissionDetail, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.8 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.fromBorderSide(BorderSide( + color: Color(0xffBBBBBB), + width: 1, + )), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(16), + child: Column( + children: [ + Row( + children: [ + Container( + width: 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context).dateTime, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ), + AppText( + "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}", + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context).admissionNo, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ), + AppText( + patient.admissionNo, + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context).losNo, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ), + AppText( + DateUtils.differenceBetweenServerDateAndCurrent(patient.admissionDate), + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + ], + ), + ), + const Divider( + color: Color(0xffCCCCCC), + height: 5, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Container( + height: 10 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).area, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.clinicDescription, + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).room, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + SizedBox( + width: 4, + ), + AppText( + "${patient.nursingStationName}\n${patient.roomId}", + fontWeight: FontWeight.normal, + fontSize: 1.4 * SizeConfig.textMultiplier, + ), + ], + ), + ), + SizedBox( + height: 4, + ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).bed, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + SizedBox( + width: 4, + ), + AppText( + "${patient.bedId}", + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ) + ], + ), + ) + ], + ), + ), + ], + ), + ], + ), ), + SliverPadding( + padding: const EdgeInsets.all(16.0), + sliver: ProfileMedicalInfoWidget( + patient: patient, + )) + ]), + ); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), ), - SliverPadding( - padding: const EdgeInsets.fromLTRB(20, 30, 15, 10), - sliver: ProfileMedicalInfoWidget( - patient: patient, - )) - ]); + child: avatarIcon, + ); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 092edb02..b8136026 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import '../../../config/size_config.dart'; @@ -29,26 +30,30 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - name: TranslationBase.of(context).vitalSign, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, icon: 'heartbeat.png'), PatientProfileButton( key: key, patient: patient, route: LAB_ORDERS, - name: TranslationBase.of(context).labOrder, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, route: PRESCRIPTIONS, - name: TranslationBase.of(context).prescription, + nameLine1: TranslationBase.of(context).medicines, + nameLine2: TranslationBase.of(context).prescription, icon: 'note.png'), PatientProfileButton( key: key, patient: patient, route: RADIOLOGY, - name: TranslationBase.of(context).radiology, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, icon: 'radiology-1.png'), Visibility( visible: selectedPatientType != 0 && selectedPatientType != 5, @@ -56,13 +61,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: PROGRESS_NOTE, - name: TranslationBase.of(context).progressNote, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png')), PatientProfileButton( key: key, patient: patient, route: PATIENT_INSURANCE_APPROVALS, - name: TranslationBase.of(context).insuranceApprovals, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, icon: 'lab.png'), Visibility( visible: selectedPatientType != 0 && @@ -72,7 +79,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: REFER_PATIENT, - name: TranslationBase.of(context).myReferralPatient, + nameLine1: TranslationBase.of(context).myReferral, + nameLine2: TranslationBase.of(context).patient, icon: 'note.png')), Visibility( visible: selectedPatientType != 0 && selectedPatientType != 5, @@ -80,7 +88,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: PATIENT_ORDERS, - name: TranslationBase.of(context).orders, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).list, icon: 'radiology-1.png')), ]); } @@ -136,13 +145,14 @@ class CircleAvatarWidget extends StatelessWidget { } class PatientProfileButton extends StatelessWidget { - final String name; + final String nameLine1; + final String nameLine2; final String icon; final dynamic route; final PatiantInformtion patient; final String url = "assets/images/"; PatientProfileButton( - {Key key, this.patient, this.name, this.icon, this.route}) + {Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) : super(key: key); @override Widget build(BuildContext context) { @@ -156,12 +166,25 @@ class PatientProfileButton extends StatelessWidget { Container( alignment: Alignment.topLeft, padding: EdgeInsets.all(5), - child: new AppText( - this.name, - color: Colors.red, - fontWeight: FontWeight.w600, - textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 2, + child: + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + this.nameLine1, + color: Color(0xFFB9382C), + fontWeight: FontWeight.w600, + textAlign: TextAlign.left, + fontSize: SizeConfig.textMultiplier * 2, + ), + AppText( + this.nameLine2, + color: Colors.black, + fontWeight: FontWeight.w600, + textAlign: TextAlign.left, + fontSize: SizeConfig.textMultiplier * 2, + ), + ], ), ), Expanded( @@ -181,6 +204,10 @@ class PatientProfileButton extends StatelessWidget { // border: Border.all(), color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10)), + border: Border.fromBorderSide(BorderSide( + color: Color(0xffBBBBBB), + width: 1, + )), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), From 5905311d12faa2b0754ddeaea83a31051d306699 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Dec 2020 13:27:21 +0200 Subject: [PATCH 2/3] small fixes in patient profile --- .../profile/patient_profile_widget.dart | 380 +++++++++--------- 1 file changed, 197 insertions(+), 183 deletions(-) diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 22885baa..5fefcc1f 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -4,9 +4,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; + import './profile_medical_info_widget.dart'; /* @@ -188,203 +187,218 @@ class PatientProfileWidget extends StatelessWidget { ), ]), ), - Container( - margin: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).admissionDetail, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.8 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - Container( - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), - width: 1, - )), + if (patient.admissionNo != null) + Container( + margin: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).admissionDetail, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.8 * SizeConfig.textMultiplier, ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(16), - child: Column( - children: [ - Row( - children: [ - Container( - width: 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context).dateTime, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - ), - AppText( - "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}", - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context).admissionNo, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + SizedBox( + height: 4, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.fromBorderSide(BorderSide( + color: Color(0xffBBBBBB), + width: 1, + )), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(16), + child: Column( + children: [ + Row( + children: [ + Container( + width: 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context).dateTime, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), ), - ), - AppText( - patient.admissionNo, - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context).losNo, + AppText( + patient.admissionDate != null + ? "${DateUtils + .convertDateFromServerFormat( + patient.admissionDate, + 'EEEE dd, MMMM yyyy hh:mm a')}" + : "", color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontWeight: FontWeight.normal, + fontSize: + 1.6 * SizeConfig.textMultiplier, ), - ), - AppText( - DateUtils.differenceBetweenServerDateAndCurrent(patient.admissionDate), - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - ], - ), - ], - ), - ), - const Divider( - color: Color(0xffCCCCCC), - height: 5, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Container( - height: 10 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).area, + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context).admissionNo, + color: Colors.black, fontWeight: FontWeight.bold, fontSize: 1.6 * SizeConfig.textMultiplier, ), - SizedBox( - height: 4, - ), - AppText( - patient.clinicDescription, - fontWeight: FontWeight.normal, + ), + AppText( + patient.admissionNo != null + ? patient.admissionNo + : '', + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context).losNo, + color: Colors.black, + fontWeight: FontWeight.bold, fontSize: 1.6 * SizeConfig.textMultiplier, ), - ], + ), + AppText( + patient.admissionDate != null + ? DateUtils + .differenceBetweenServerDateAndCurrent( + patient.admissionDate) + : "", + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ], + ), + ], + ), + ), + const Divider( + color: Color(0xffCCCCCC), + height: 5, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Container( + height: 10 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).area, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.clinicDescription, + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), ), ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).room, - fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - SizedBox( - width: 4, - ), - AppText( - "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: FontWeight.normal, - fontSize: 1.4 * SizeConfig.textMultiplier, - ), - ], + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).room, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + SizedBox( + width: 4, + ), + AppText( + "${patient.nursingStationName}\n${patient.roomId}", + fontWeight: FontWeight.normal, + fontSize: 1.4 * SizeConfig.textMultiplier, + ), + ], + ), ), - ), - SizedBox( - height: 4, - ), - Expanded( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).bed, - fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - SizedBox( - width: 4, - ), - AppText( - "${patient.bedId}", - fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - ], + SizedBox( + height: 4, ), - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).bed, + fontWeight: FontWeight.bold, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + SizedBox( + width: 4, + ), + AppText( + "${patient.bedId}", + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ], + ), ), ), - ), - ], - ), - ) - ], - ), - ) - ], + ], + ), + ) + ], + ), + ) + ], + ), ), - ), ], ), ], From 89729e45379be995cecd024160239ed7548a5335 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 14 Dec 2020 14:02:37 +0200 Subject: [PATCH 3/3] fix my referred widget --- .../doctor/my_referred_patient_widget.dart | 511 +++++++++--------- 1 file changed, 254 insertions(+), 257 deletions(-) diff --git a/lib/widgets/doctor/my_referred_patient_widget.dart b/lib/widgets/doctor/my_referred_patient_widget.dart index d9adaf3b..88063f93 100644 --- a/lib/widgets/doctor/my_referred_patient_widget.dart +++ b/lib/widgets/doctor/my_referred_patient_widget.dart @@ -8,7 +8,7 @@ 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/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -35,279 +35,276 @@ class _MyReferredPatientWidgetState extends State { @override Widget build(BuildContext context) { - return CardWithBgWidgetNew( - widget: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - '${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}', - fontSize: 2.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - InkWell( + return Container( + width: double.infinity, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 10), + padding: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.fromBorderSide(BorderSide( + color: Color(0xffCCCCCC), + width: 2, + )), + color: Color(0xffffffff), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + HeaderBodyExpandableNotifier( + headerWidget: Container( + margin: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + '${widget.myReferredPatientModel.firstName} ${widget.myReferredPatientModel.lastName}', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + InkWell( onTap: () { setState(() { _showDetails = !_showDetails; }); }, - child: Icon(_showDetails - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down)), - ], + child: Image.asset( + "assets/images/ic_circle_arrow.png", + width: 25, + height: 25, + color: Colors.black, + ), + ), + ], + ), ), - !_showDetails - ? Container() - : AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - Divider( - color: Color(0xFF000000), - height: 0.5, - ), - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - ), - children: [ - TableRow(children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - decoration: BoxDecoration(), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).fileNo, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferredPatientModel.patientId}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - Container( - margin: EdgeInsets.only( - left: 4, - top: 2.5, - right: 2.5, - bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).referralDoctor, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Texts( - widget.myReferredPatientModel - .referralDoctorName, - maxLength: 80, - readMore: true, - ), - ], - ), - ), - ]), - TableRow( - children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).referringClinic, - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferredPatientModel.referralClinicDescription}', - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - Container( - margin: EdgeInsets.only( - left: 4, - top: 2.5, - right: 2.5, - bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).frequency, - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - widget.myReferredPatientModel - .frequencyDescription, - fontSize: 1.7 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ) - ], + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + ), + children: [ + TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + decoration: BoxDecoration(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).fileNo, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), - TableRow(children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).priority, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - '${widget.myReferredPatientModel.priorityDescription}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - Container( - margin: EdgeInsets.only( - left: 4, - top: 2.5, - right: 2.5, - bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).maxResponseTime, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - AppText( - Helpers.getDateFormatted(widget - .myReferredPatientModel - .maxResponseTime), - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ) - ]) + AppText( + '${widget.myReferredPatientModel.patientId}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) ], ), - Divider( - color: Color(0xFF000000), - height: 0.5, - ), - SizedBox( - height: 5, - ), - AppText( - TranslationBase.of(context).clinicDetailsandRemarks, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - textAlign: TextAlign.start, - ), - SizedBox( - height: 5, - ), - Texts( - '${widget.myReferredPatientModel.referringDoctorRemarks}', - style: "bodyText1", - readMore: true, - textAlign: TextAlign.start, - maxLength: 100), - SizedBox( - height: 5, - ), - AppText( - TranslationBase.of(context).answerSuggestions, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - textAlign: TextAlign.start, - ), - SizedBox( - height: 5, + ), + Container( + margin: EdgeInsets.only( + left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).referralDoctor, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + Texts( + widget.myReferredPatientModel + .referralDoctorName, + maxLength: 80, + readMore: true, + ), + ], ), - Texts( - '${widget.myReferredPatientModel.referredDoctorRemarks}', - style: "bodyText1", - readMore: true, - textAlign: TextAlign.start, - maxLength: 100), - SizedBox( - height: 5, + ), + ]), + TableRow( + children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).referringClinic, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferredPatientModel.referralClinicDescription}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), ), - SizedBox(height: 10.0), Container( - width: double.infinity, - child: Button( - onTap: () async { - try { - - await widget.model.verify(widget.myReferredPatientModel); - - DrAppToastMsg.showSuccesToast('Verify Successfully'); - } catch (e) { - - DrAppToastMsg.showErrorToast(e); - } - }, - title: TranslationBase.of(context).verify, - loading: widget.model.state == ViewState.BusyLocal, + margin: EdgeInsets.only( + left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).frequency, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + widget.myReferredPatientModel + .frequencyDescription, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), ) ], - ) + ), + TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + '${widget.myReferredPatientModel.priorityDescription}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ), + Container( + margin: EdgeInsets.only( + left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).maxResponseTime, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + AppText( + Helpers.getDateFormatted(widget + .myReferredPatientModel.maxResponseTime), + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ) + ]) ], ), - ) - ], - ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + SizedBox( + height: 5, + ), + Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).clinicDetailsandRemarks, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, + ), + SizedBox( + height: 5, + ), + Texts( + '${widget.myReferredPatientModel.referringDoctorRemarks}', + style: "bodyText1", + readMore: true, + textAlign: TextAlign.start, + maxLength: 100), + SizedBox( + height: 5, + ), + AppText( + TranslationBase.of(context).answerSuggestions, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, + ), + SizedBox( + height: 5, + ), + Texts( + '${widget.myReferredPatientModel.referredDoctorRemarks}', + style: "bodyText1", + readMore: true, + textAlign: TextAlign.start, + maxLength: 100), + ], + ), + ), + SizedBox( + height: 5, + ), + SizedBox(height: 10.0), + Container( + margin: EdgeInsets.all(10), + width: double.infinity, + child: Button( + onTap: () async { + try { + await widget.model + .verify(widget.myReferredPatientModel); + + DrAppToastMsg.showSuccesToast( + 'Verify Successfully'); + } catch (e) { + DrAppToastMsg.showErrorToast(e); + } + }, + title: TranslationBase.of(context).verify, + loading: widget.model.state == ViewState.BusyLocal, + ), + ) + ], + ) + ], + ), + isExpand: _showDetails, + ) + ], ), ); }