From 019553ba51a4d7138edffa3eb72f407ec6b9a326 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 29 Mar 2021 12:16:43 +0300 Subject: [PATCH 01/16] new design for ESG service --- lib/config/config.dart | 4 +- lib/screens/patients/ECGPage.dart | 94 ++++++++++++++++++--- lib/util/date-utils.dart | 13 +++ lib/widgets/shared/Text.dart | 2 +- lib/widgets/shared/app_scaffold_widget.dart | 6 +- 5 files changed, 102 insertions(+), 17 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f615af5..3a72faba 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba76c031..69be86e9 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,7 +1,10 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -13,7 +16,8 @@ class ECGPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patient-type']; + String arrivalType = routeArgs['arrival-type']; return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -21,28 +25,96 @@ class ECGPage extends StatelessWidget { patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: 'ECG', - body: ListView.builder( - itemCount: model.patientMuseResultsModelList.length, - itemBuilder: (context, index) => InkWell( + isShowAppBar: false, + backgroundColor: Color(0xffF8F8F8), + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Texts('Service',style: "caption2",color: Colors.black,), + Texts('ECG',bold: true,fontSize: 22,), + SizedBox(height: 12,), + ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { await launch( model.patientMuseResultsModelList[index].imageURL); }, child: Container( width: double.infinity, - margin: EdgeInsets.all(5), + height: 90, + margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), decoration: BoxDecoration( - border: Border.all(color: Colors.grey,width: 2) + border: Border.all(color: Colors.white,width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8) ), - child: Center( - child: Texts( - "${model.patientMuseResultsModelList[index].createdOnDateTime}"), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('ECG Report',bold: true,fontSize: 14,), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).orderNo, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: '${model.patientMuseResultsModelList[index].orderNo?? ''}', + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ) + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Texts('${DateUtils.getMonthDayYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime)}',color: Colors.black,), + Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',), + ], + ), + ), + ], + ), + Align( + alignment: Alignment.topRight, + child: Icon(Icons.arrow_circle_up_rounded), + ) + ], ), ), )), + + ], + ), + ), + ), ), ); } diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 51089567..253b0f55 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -267,6 +267,19 @@ class DateUtils { return ""; } + /// get data formatted like Apr 26,2020 + /// [dateTime] convert DateTime to data formatted + static String getHour(DateTime dateTime) { + // if (dateTime != null) + // return getMonth(dateTime.hour) + + // " " + + // dateTime.day.toString() + + // ", " + + // dateTime.year.toString(); + // else + return DateFormat('hh:mm a').format(dateTime); + } + static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart index 4f2c4271..59929075 100644 --- a/lib/widgets/shared/Text.dart +++ b/lib/widgets/shared/Text.dart @@ -216,7 +216,7 @@ class _TextsState extends State { fontSize:widget.fontSize?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1.5 : null, - fontWeight: _getFontWeight(), + fontWeight: widget.fontWeight ?? _getFontWeight(), decoration: widget.textDecoration //TextDecoration.lineThrough )), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 9842bbed..37dfda14 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -18,12 +18,13 @@ class AppScaffold extends StatelessWidget { final bool isShowAppBar; final BaseViewModel baseViewModel; final Widget bottomSheet; + final Color backgroundColor; AppScaffold( {this.appBarTitle = '', this.body, this.isLoading = false, this.isShowAppBar = true, - this.baseViewModel, this.bottomSheet}); + this.baseViewModel, this.bottomSheet, this.backgroundColor}); @override Widget build(BuildContext context) { @@ -34,7 +35,7 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: Colors.white, + backgroundColor: backgroundColor??Colors.white, appBar: isShowAppBar ? AppBar( elevation: 0, @@ -59,7 +60,6 @@ class AppScaffold extends StatelessWidget { ], ) : null, - bottomSheet: bottomSheet, body: projectProvider.isInternetConnection ? baseViewModel != null From f0c65bb70be104730ba13bbb7b14d7c8f5eba385 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 29 Mar 2021 12:38:40 +0300 Subject: [PATCH 02/16] change color and font for ESG service --- lib/screens/patients/ECGPage.dart | 20 ++++++++++++-------- lib/util/date-utils.dart | 26 ++++++++++++++++---------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 69be86e9..ffb12ee1 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.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/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -9,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @@ -18,6 +20,7 @@ class ECGPage extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -34,7 +37,7 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox(height: 12,), + SizedBox(height: 12,), Texts('Service',style: "caption2",color: Colors.black,), Texts('ECG',bold: true,fontSize: 22,), SizedBox(height: 12,), @@ -45,7 +48,7 @@ class ECGPage extends StatelessWidget { }, child: Container( width: double.infinity, - height: 90, + height: 110, margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), decoration: BoxDecoration( @@ -62,7 +65,8 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('ECG Report',bold: true,fontSize: 14,), + Texts('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + SizedBox(height:3), RichText( text: TextSpan( style: TextStyle( @@ -78,10 +82,9 @@ class ECGPage extends StatelessWidget { fontFamily: 'Poppins')), new TextSpan( - text: '${model.patientMuseResultsModelList[index].orderNo?? ''}', + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', style: TextStyle( - fontWeight: - FontWeight.w700, + fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)), @@ -95,13 +98,14 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Texts('${DateUtils.getMonthDayYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime)}',color: Colors.black,), - Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',), + Texts('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), ], ), ), ], ), + SizedBox(height: 15,), Align( alignment: Alignment.topRight, child: Icon(Icons.arrow_circle_up_rounded), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 253b0f55..4c11e43b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -256,9 +256,9 @@ class DateUtils { /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted - static String getMonthDayYearDateFormatted(DateTime dateTime) { + static String getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) - return getMonth(dateTime.month) + + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + @@ -267,16 +267,22 @@ class DateUtils { return ""; } - /// get data formatted like Apr 26,2020 + /// get data formatted like 26 Apr 2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { + if (dateTime != null) + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString(); + else + return ""; + } + + /// get data formatted like 10:45 PM /// [dateTime] convert DateTime to data formatted static String getHour(DateTime dateTime) { - // if (dateTime != null) - // return getMonth(dateTime.hour) + - // " " + - // dateTime.day.toString() + - // ", " + - // dateTime.year.toString(); - // else return DateFormat('hh:mm a').format(dateTime); } From 747a0b7da4a6eb4b5c87cc68c7e8180fc74e71d0 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 29 Mar 2021 15:18:38 +0300 Subject: [PATCH 03/16] change the lab result design --- .../profile/lab_result/labs_home_page.dart | 121 +++----- .../radiology/radiology_home_page.dart | 16 +- .../prescription/prescriptions_page.dart | 25 +- lib/util/date-utils.dart | 5 +- .../shared/app_expandable_notifier_new.dart | 1 + lib/widgets/shared/doctor_card.dart | 258 +++++++----------- 6 files changed, 165 insertions(+), 261 deletions(-) diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index c0118e5f..e2388156 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -5,6 +5,8 @@ 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/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,94 +22,61 @@ class LabsHomePage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - ProjectViewModel projectViewModel = Provider.of(context); + String patientType = routeArgs['patient-type']; + String arrivalType = routeArgs['arrival-type']; return BaseView( onModelReady: (model) => model.getLabs(patient), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labOrders, + isShowAppBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( widthFactor: 1.0, - child: Center( - child: Column( - children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) => - model.setFilterType(value), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Lab',style: "caption2",color: Colors.black,fontSize: 13,), + Texts('Result',bold: true,fontSize: 22,), + ], + ), + ), + ...List.generate( + model.patientLabOrdersList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .patientLabOrdersList[index].patientLabOrdersList + .map((labOrder) { + return DoctorCard( + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + patient: patient, ), ), ), - ) - ], + doctorName: labOrder.doctorName, + invoiceNO: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + branch: labOrder.projectName, + appointmentDate: labOrder.orderDate, + orderNo: labOrder.orderNo, + ); + }).toList(), ), - ...List.generate( - model.patientLabOrdersList.length, - (index) => AppExpandableNotifier( - title: model.patientLabOrdersList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .patientLabOrdersList[index].patientLabOrdersList - .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - ), - ), - ), - isInOutPatient: labOrder.isInOutPatient, - name: labOrder.doctorName, - billNo: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - subName: labOrder.projectName, - isLiveCareAppointment: - labOrder.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - labOrder.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - labOrder.orderDate), - ); - }).toList(), - ), - ), - ) - ], - ), + ) + ], ), ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index cce155d2..4698def1 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -88,18 +88,12 @@ class RadiologyHomePage extends StatelessWidget { ), ), child: DoctorCard( - isInOutPatient: radiology.isInOutPatient, - isLiveCareAppointment: - radiology.isLiveCareAppointment, - name: radiology.doctorName, + doctorName: radiology.doctorName, profileUrl: radiology.doctorImageURL, - billNo: '${radiology.invoiceNo}', - subName: '${radiology.projectName}', - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - radiology.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - radiology.orderDate), + invoiceNO: '${radiology.invoiceNo}', + branch: '${radiology.projectName}', + appointmentDate: radiology.orderDate, + orderNo: radiology.orderNo.toString(), ), ); }).toList(), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index d595ff0b..039bd7f2 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -93,24 +93,15 @@ class PrescriptionsPage extends StatelessWidget { ), ), child: DoctorCard( - name: prescriptions.doctorName, + doctorName: prescriptions.doctorName, profileUrl: prescriptions.doctorImageURL, - rat: - prescriptions.actualDoctorRate.toDouble(), - subName: prescriptions.name, - isInOutPatient: prescriptions.isInOutPatient, - isLiveCareAppointment: - prescriptions.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils - .getMonthDayYearDateFormattedAr( - DateUtils.convertStringToDate( - prescriptions - .appointmentDate)) - : DateUtils.getMonthDayYearDateFormatted( - DateUtils.convertStringToDate( - prescriptions.appointmentDate)), - ), + branch: prescriptions.name, + appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate,), + orderNo: prescriptions.appointmentNo.toString(), + invoiceNO:prescriptions.appointmentNo.toString(), + + ) + ); }).toList(), )), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 4c11e43b..a78b34c8 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -271,10 +271,9 @@ class DateUtils { /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) - return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + - " " + - dateTime.day.toString() + + return dateTime.day.toString()+" "+ "${isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) }"+ " " + + dateTime.year.toString(); else return ""; diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart index ea5777a5..848f5265 100644 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -47,6 +47,7 @@ class _AppExpandableNotifier extends State { child: Padding( padding: const EdgeInsets.only(left: 10, right: 10, top: 4), child: Card( + color: Colors.grey[200], clipBehavior: Clip.antiAlias, child: Column( children: [ diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 6493c916..047d567c 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -1,7 +1,8 @@ - import 'package:doctor_app_flutter/core/viewModel/project_view_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/patients/profile/large_avatar.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -11,28 +12,22 @@ import 'StarRating.dart'; import 'Text.dart'; class DoctorCard extends StatelessWidget { - final String name; - final String subName; - final double rat; - final String date; + final String doctorName; + final String branch; + final DateTime appointmentDate; final String profileUrl; - final String billNo; + final String invoiceNO; + final String orderNo; final Function onTap; - final Function onEmailTap; - final bool isInOutPatient; - final bool isLiveCareAppointment; DoctorCard( - {this.name, - this.subName, - this.rat, - this.date, + {this.doctorName, + this.branch, this.profileUrl, - this.billNo, + this.invoiceNO, this.onTap, - this.onEmailTap, - this.isInOutPatient, - this.isLiveCareAppointment = false}); + this.appointmentDate, + this.orderNo}); @override Widget build(BuildContext context) { @@ -42,155 +37,110 @@ class DoctorCard extends StatelessWidget { decoration: BoxDecoration( border: Border.all( width: 0.5, - color: Theme.of(context).primaryColor, + color: Colors.white, ), borderRadius: BorderRadius.all( - Radius.circular(8.0), + Radius.circular(15.0), ), color: Colors.white), - child: InkWell( - onTap: onTap, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: projectViewModel.isArabic ? 27 : 20, - height: date == null - ? projectViewModel.isArabic - ? 185 - : 100 - : 180, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: isLiveCareAppointment - ? Color(0xff404545) - : !isInOutPatient - ? Colors.red[900] - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - bottomLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - topRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), - bottomRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Texts( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Texts( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + Texts( + '${DateUtils.getHour(appointmentDate)}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], ), ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !isInOutPatient - ? TranslationBase.of(context) - .inPatient - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 55, + height: 55, + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: name, - url: profileUrl, + if (orderNo != null) + Row( + children: [ + Texts( + 'order No:', + color: Colors.grey[500], + ), + Texts( + orderNo ?? '', + ) + ], ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).dr + - " " + - name, - bold: true, - ), - Texts( - subName, - ), - if (billNo != null) - Row( - children: [ - Texts( - '${TranslationBase.of(context).billNo}: ', - ), - Texts( - billNo, - ) - ], - ), - if (rat != null) - StarRating( - totalAverage: rat, forceStars: true), - ], - ), + if (invoiceNO != null) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[500], + ), + Texts( + invoiceNO, + ) + ], ), - ), - if (onEmailTap != null) - InkWell( - onTap: onEmailTap, - child: Icon( - Icons.email, - color: Theme.of(context).primaryColor, + Row( + children: [ + Texts( + 'Branch:', + color: Colors.grey[500], ), - ), - ], - ), - ), - if (date != null) - Divider( - height: 8, - color: Colors.grey[400], - ), - if (date != null) - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - Icons.calendar_today_outlined, - size: 30, - color: Colors.red, - ), - Expanded( - child: Texts( - date, - variant: 'bodyText', - ), + Texts( + branch, + ) + ], ) - ], - ) - ], + ]), + ), ), - ) - ], - ), - ], + Icon( + EvaIcons.eye, + ) + ], + ), + ], + ), ), ), ); From f74fdc80f6fb34bc5e79fb47c39c9a3b46ef3cc6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 29 Mar 2021 16:50:06 +0300 Subject: [PATCH 04/16] fix doctor replay --- lib/widgets/doctor/doctor_reply_widget.dart | 618 +++++++++++++------- 1 file changed, 414 insertions(+), 204 deletions(-) diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index f3882e23..5660fde6 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.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/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -22,224 +22,434 @@ class DoctorReplyWidget extends StatefulWidget { class _DoctorReplyWidgetState extends State { @override Widget build(BuildContext context) { - return Stack( - children: [ - Container( - margin: EdgeInsets.symmetric(vertical: 10.0), - width: double.infinity, - decoration: BoxDecoration( - color: HexColor('#FFFFFF'), - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - children: [ - SizedBox(height: 18,), - Container( - margin: EdgeInsets.only(right: 15), - child: Row( + return Container( + child: CardWithBgWidget( + bgColor: + widget.reply.status == 1 + ? Color(0xffc4aa54) + : Colors.red[700], + hasBorder: false, + widget: Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: widget.reply.infoStatus!=null ? widget.reply.infoStatus :'', + style: TextStyle( + color: widget.reply.status != null + ? widget.reply.status == 1 + ? Color(0xffc4aa54) + : widget.reply.status == 2 + ? Colors.green[700] + : Colors.red[700] + : Colors.grey[500], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 2.0 * SizeConfig.textMultiplier)), + ], + ), + ), + AppText( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + + " " + + DateUtils.getMonth( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + Row( + children: [ + Expanded( + child: AppText( + Helpers.capitalize( widget.reply.patientName), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + ), + SizedBox( + width: 4, + ), + widget.reply.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ], + ), + SizedBox( + height: 20, + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - SizedBox(width: 5,), - //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), - colors: [ - Colors.grey[100], - Colors.grey[200], - ]), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), - ), - width: 80, - height: 80, - child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + widget.reply.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), - SizedBox(width: 15,), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.reply.patientName, - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), + ], + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - '${widget.reply.patientID}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).mobileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - widget.reply.mobileNumber, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), + children: [ + + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')), + new TextSpan( + text: widget.reply.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), ], ), - SizedBox( - height: 5, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 70, - height: 20, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(60.0)), - color: Colors.green[600] - ), - child: Center( - child: AppText( - widget.reply.requestTime, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Colors.white, - ), - ), - ), - Container( - - child: AppText( - '${Helpers.getDate(widget.reply.requestDate)}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - color: Colors.black, - ), + ), + Container( + width: MediaQuery.of(context).size.width*0.45, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), - ], + children: [ + new TextSpan( + text: TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), ), - - ], - ), + ) + ], ), - ) - ], - ), - ), - !widget.isShowMore ? SizedBox(height: 18,) : - AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Divider(color: Colors.grey), - SizedBox(height: 5,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.remarks, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), ], ), - SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).doctorResponse + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.doctorResponse, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).doctorResponse + " : ", + style: + TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: widget.reply.remarks, + style: TextStyle( + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontSize: 15)), + ], ), - ], - ),SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).infoStatus + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.infoStatus, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), - ], - ) - ], - ), + ), + ), + ],) + ], ), - ], - ), + SizedBox( + height: 20, + ), + ], ), - ), - Positioned( - right: 5, - top: 20, - child: InkWell( - onTap: (){ - setState(() { - widget.isShowMore = !widget.isShowMore; - }); - }, - child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), - ) - ], - + // onTap: onTap, + )), + ), ); + // Stack( + // children: [ + // Container( + // margin: EdgeInsets.symmetric(vertical: 10.0), + // width: double.infinity, + // decoration: BoxDecoration( + // color: HexColor('#FFFFFF'), + // borderRadius: BorderRadius.all( + // Radius.circular(20.0), + // ), + // ), + // child: Container( + // margin: EdgeInsets.all(5), + // child: Column( + // children: [ + // SizedBox(height: 18,), + // Container( + // margin: EdgeInsets.only(right: 15), + // child: Row( + // children: [ + // SizedBox(width: 5,), + // //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), + // Container( + // decoration: BoxDecoration( + // gradient: LinearGradient( + // begin: Alignment(-1, -1), + // end: Alignment(1, 1), + // colors: [ + // Colors.grey[100], + // Colors.grey[200], + // ]), + // boxShadow: [ + // BoxShadow( + // color: Color.fromRGBO(0, 0, 0, 0.08), + // offset: Offset(0.0, 5.0), + // blurRadius: 16.0) + // ], + // borderRadius: BorderRadius.all(Radius.circular(50.0)), + // ), + // width: 80, + // height: 80, + // child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + // + // SizedBox(width: 15,), + // Expanded( + // child: Container( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // widget.reply.patientName, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // SizedBox( + // height: 5, + // ), + // + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).fileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // '${widget.reply.patientID}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).mobileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // widget.reply.mobileNumber, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Container( + // width: 70, + // height: 20, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all(Radius.circular(60.0)), + // color: Colors.green[600] + // ), + // child: Center( + // child: AppText( + // widget.reply.requestTime, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // color: Colors.white, + // ), + // ), + // ), + // Container( + // + // child: AppText( + // '${Helpers.getDate(widget.reply.requestDate)}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // color: Colors.black, + // ), + // ), + // ], + // ), + // + // ], + // ), + // ), + // ) + // + // ], + // ), + // ), + // + // !widget.isShowMore ? SizedBox(height: 18,) : + // AnimatedContainer( + // duration: Duration(milliseconds: 200), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Divider(color: Colors.grey), + // SizedBox(height: 5,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).remarks + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.remarks, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).doctorResponse + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.doctorResponse, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ),SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).infoStatus + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.infoStatus, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ) + // ], + // ), + // ), + // + // ], + // ), + // ), + // ), + // Positioned( + // right: 5, + // top: 20, + // child: InkWell( + // onTap: (){ + // setState(() { + // widget.isShowMore = !widget.isShowMore; + // }); + // }, + // child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + // ) + // ], + // + // ); } } From 83762fbd6ea1f37804468c7e8d8b73c97b88ef2d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 30 Mar 2021 16:32:02 +0300 Subject: [PATCH 05/16] change the lab result design --- .../lab_result/laboratory_result_page.dart | 44 +- .../profile/lab_result/labs_home_page.dart | 8 +- ..._profile_header_with_appointment_card.dart | 460 ++++++++++++++++++ 3 files changed, 496 insertions(+), 16 deletions(-) create mode 100644 lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 398479c4..ddbbcd45 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -3,18 +3,21 @@ import 'package:doctor_app_flutter/core/viewModel/labs_view_model.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/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'laboratory_result_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; class LaboratoryResultPage extends StatefulWidget { final PatientLabOrders patientLabOrders; final PatiantInformtion patient; - - LaboratoryResultPage({Key key, this.patientLabOrders, this.patient}); + final String patientType; + final String arrivalType; + LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -31,22 +34,35 @@ class _LaboratoryResultPageState extends State { orderNo: widget.patientLabOrders.orderNo, patient: widget.patient), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labResults, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).labResults, baseViewModel: model, body: Scaffold( - body: ListView.builder( - itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () async { + body: SingleChildScrollView( + child: Column( + children: [ + PatientProfileHeaderWhitAppointment(patient: widget.patient, + patientType: widget.patientType??"0", + arrivalType: widget.arrivalType??"0", + orderNo: widget.patientLabOrders.orderNo, + appointmentDate:widget.patientLabOrders.orderDate, + doctorName: widget.patientLabOrders.doctorName, + profileUrl: widget.patientLabOrders.doctorImageURL, + invoiceNO: widget.patientLabOrders.invoiceNo, + ), + ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( + onTap: () async { + + }, + billNo: widget.patientLabOrders.invoiceNo, + details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + )), - }, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, + ], ), - itemCount: model.patientLabSpecialResult.length, ), ), ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index e2388156..1cf19edb 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -18,12 +18,14 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LabsHomePage extends StatelessWidget { + String patientType; + String arrivalType; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patient-type']; - String arrivalType = routeArgs['arrival-type']; + patientType = routeArgs['patient-type']; + arrivalType = routeArgs['arrival-type']; return BaseView( onModelReady: (model) => model.getLabs(patient), builder: (context, LabsViewModel model, widget) => AppScaffold( @@ -63,6 +65,8 @@ class LabsHomePage extends StatelessWidget { page: LaboratoryResultPage( patientLabOrders: labOrder, patient: patient, + arrivalType: arrivalType, + patientType: patientType, ), ), ), diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart new file mode 100644 index 00000000..26f474e2 --- /dev/null +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -0,0 +1,460 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_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/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/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; + +import 'large_avatar.dart'; + +class PatientProfileHeaderWhitAppointment extends StatelessWidget { + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + + PatientProfileHeaderWhitAppointment( + {this.patient, + this.patientType, + this.arrivalType, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 300, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + 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, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient + .appointmentDate + .toString()), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 30, + height: 30, + margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border( + bottom:BorderSide(color: Colors.grey[400],width: 2.5), + left: BorderSide(color: Colors.grey[400],width: 2.5), + ) + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${TranslationBase.of(context).dr}.$doctorName', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (orderNo != null) + Row( + children: [ + Texts( + 'Order No:', + color: Colors.grey[800], + ), + Texts( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[800], + ), + Texts( + invoiceNO, + ) + ], + ), + Row( + children: [ + Texts( + 'Result Date:', + color: Colors.grey[800], + ), + Texts( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ) + ], + ) + ]), + ), + ), + + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String timeConvert; + 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))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } +} From 920ec14bc200492add64db994a0e5ecbafc7852d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 30 Mar 2021 21:36:17 +0300 Subject: [PATCH 06/16] add new design for Lab Result and Radiology Results --- lib/config/localized_values.dart | 4 +- lib/core/viewModel/labs_view_model.dart | 5 + .../profile/lab_result/LabResultWidget.dart | 157 ++++++++++-------- .../lab_result/laboratory_result_widget.dart | 120 ++----------- .../profile/lab_result/labs_home_page.dart | 42 ++++- .../radiology/radiology_details_page.dart | 85 +++++----- .../radiology/radiology_home_page.dart | 81 +++++---- .../prescription/prescription_items_page.dart | 44 +++++ .../prescription/prescriptions_page.dart | 134 +++++++-------- lib/widgets/shared/app_button.dart | 21 ++- 10 files changed, 364 insertions(+), 329 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 662111d0..7229f9f6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -124,10 +124,10 @@ const Map> localizedValues = { 'ar': 'ليس لديك اي ملاحظة تقدم ' }, 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, - 'generalResult': {'en': 'General Result :', 'ar': 'النتيجة العامة'}, + 'generalResult': {'en': 'General Result ', 'ar': 'النتيجة العامة'}, 'description': {'en': 'Description', 'ar': 'الوصف'}, 'value': {'en': 'Value', 'ar': 'القيمة'}, - 'range': {'en': 'range', 'ar': 'النطاق'}, + 'range': {'en': 'Range', 'ar': 'النطاق'}, 'enterId': {'en': 'Enter ID', 'ar': 'الهوية'}, 'pleaseEnterYourID': { 'en': 'Please enter your ID', diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 3f457956..43851649 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -88,6 +88,11 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); + List get labResultListsCoustom { + + return labResultLists; + } + getLaboratoryResult( {String projectID, int clinicID, diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 57b4614d..c20a48ae 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -13,11 +13,10 @@ import 'package:provider/provider.dart'; class LabResultWidget extends StatelessWidget { - final String filterName ; final List patientLabResultList; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; - LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); + LabResultWidget({Key key, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -29,38 +28,88 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ - Texts(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - ), + Expanded( + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - ); - }, - child: Texts( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, + ), + ), + ), + 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,), + ), + ), + ) ], ), - Table( - border: TableBorder.symmetric( - inside: BorderSide( - width: 2.0, color: Colors.grey[300]), - ), - children: fullData(patientLabResultList,context), - ), + 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), + // ), ], ), ); @@ -71,54 +120,22 @@ class LabResultWidget extends StatelessWidget { 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, - ), + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - 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), + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + ), ), 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), + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + ), ), ], ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 25663fa6..a2c8411d 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -34,7 +34,6 @@ class LaboratoryResultWidget extends StatefulWidget { } class _LaboratoryResultWidgetState extends State { - bool _isShowMore = true; bool _isShowMoreGeneral = true; ProjectViewModel projectViewModel; @@ -42,8 +41,7 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), + onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( @@ -53,33 +51,6 @@ class _LaboratoryResultWidgetState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).invoiceNo), - Texts(widget.billNo), - ], - ), - ), - ), - ], - ), - ), SizedBox( height: 12, ), @@ -106,20 +77,17 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded( - child: Texts(TranslationBase.of(context) - .generalResult)), + Expanded(child: Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: Texts(TranslationBase.of(context).generalResult,bold: true,))), Container( width: 25, height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), child: Icon( _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Colors.white, + color: Colors.grey[800], size: 22, ), ) @@ -142,22 +110,10 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate( - model.labResultLists.length, - (index) => LabResultWidget( - patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, - patient:widget.patient, - ), - ) - ], + child: LabResultWidget( + patientLabOrder: widget.patientLabOrder, + patientLabResultList: model.labResultList, + patient:widget.patient, ), ), ), @@ -167,63 +123,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 10, ), - InkWell( - onTap: () { - setState(() { - _isShowMore = !_isShowMore; - }); - }, - child: Container( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - child: Row( - children: [ - Expanded( - child: Texts( - TranslationBase.of(context).specialResult)), - Container( - width: 25, - height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), - child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 22, - ), - ) - ], - ), - ), - ), - if (_isShowMore) - AnimatedContainer( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - )), - duration: Duration(milliseconds: 7000), - child: Container( - width: double.infinity, - child: Html( - data: widget.details ?? - TranslationBase.of(context).noDataAvailable, - )), - ), + ], ), ], diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 1cf19edb..aeca5508 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -24,8 +24,9 @@ class LabsHomePage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - patientType = routeArgs['patient-type']; - arrivalType = routeArgs['arrival-type']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + print(arrivalType); return BaseView( onModelReady: (model) => model.getLabs(patient), builder: (context, LabsViewModel model, widget) => AppScaffold( @@ -50,6 +51,43 @@ class LabsHomePage extends StatelessWidget { ], ), ), + if(patientType!=null && patientType=='7') + InkWell( + onTap: (){ + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + SizedBox(height: 10,), + Texts('Apply for New Lab Order',color: Colors.grey[600],fontWeight: FontWeight.w600,) + ], + ), + ), + ), + ), + ), ...List.generate( model.patientLabOrdersList.length, (index) => Column( diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index dedb5bd5..8d27e704 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.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/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.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_scaffold_widget.dart'; @@ -15,8 +16,9 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - - RadiologyDetailsPage({Key key, this.finalRadiology, this.patient}); + final String patientType; + final String arrivalType; + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { @@ -27,54 +29,61 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, - isShowAppBar: true, + + isShowAppBar: false, baseViewModel: model, body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.center, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.start, - fontSize: 17, - ), + PatientProfileHeaderWhitAppointment(patient: patient, + patientType: patientType??"0", + arrivalType: arrivalType??"0", + orderNo: finalRadiology.orderNo.toString(), + appointmentDate:finalRadiology.orderDate, + doctorName: finalRadiology.doctorName, + profileUrl: finalRadiology.doctorImageURL, + invoiceNO: finalRadiology.invoiceNo.toString(), ), SizedBox( height: MediaQuery.of(context).size.height * 0.2, - ) - ], - ), - ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.14, - // color: Colors.grey[100], - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Divider(), - if (model.radImageURL.isNotEmpty) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - - onTap: () { - launch(model.radImageURL); - }, - title: TranslationBase.of(context).openRad, - ), + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 5,), + Texts(TranslationBase.of(context).generalResult), + SizedBox(height: 5,), + Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + color: Colors.grey, + ), + SizedBox(height: 25,), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + color: Colors.red, + onTap: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), + ), + ], ), + ), ], ), - )), + ), + ), ); } } diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 4698def1..6db06be5 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.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/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,6 +22,8 @@ class RadiologyHomePage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient), builder: (_, model, widget) => AppScaffold( @@ -31,42 +35,55 @@ class RadiologyHomePage extends StatelessWidget { child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Radiology',style: "caption2",color: Colors.black,fontSize: 13,), + Texts('Result',bold: true,fontSize: 22,), + ], + ), + ), + if(patientType!=null && patientType=='7') + InkWell( + onTap: (){ + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + SizedBox(height: 10,), + Texts('Apply for Radiology Order',color: Colors.grey[600],fontWeight: FontWeight.w600,) + ], ), ), ), - ) - ], - ), + ), + ), ...List.generate( model.finalRadiologyList.length, (index) => AppExpandableNotifier( diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 67e957a2..031ee85f 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -30,6 +30,50 @@ class PrescriptionItemsPage extends StatelessWidget { child: Container( child: Column( children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18,right: 18), + child: Texts('Name ',bold: true,)), + Row( + children: [ + SizedBox(width: 18,), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), + height: 45, + width: 45, + ), + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Route: Monthly'), + Texts('Does: 2 Time a day with 1 hour gap'), + SizedBox(height: 12,), + Texts('Note: 2 Time a day with 1 hour gap'), + ], + ),) + + + ], + ) + ], + ), + ), + ), + if (!prescriptions.isInOutPatient) ...List.generate( model.prescriptionReportList.length, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 039bd7f2..9f7e7f2f 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.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/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,92 +22,90 @@ class PrescriptionsPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPrescriptions(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + isShowAppBar: false, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order',style: "caption2",color: Colors.black,fontSize: 13,), + Texts('Prescriptions',bold: true,fontSize: 22,), + ], + ), + ), + if(patientType!=null && patientType=='7') + InkWell( + onTap: (){ + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + SizedBox(height: 10,), + Texts('Apply for New Prescriptions Order',color: Colors.grey[600],fontWeight: FontWeight.w600,) + ], ), ), ), ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), + ), + ...List.generate(model.prescriptionsList.length, (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: model.prescriptionsList[index], + patient: patient, ), ), + ), + child: DoctorCard( + doctorName: model.prescriptionsList[index].doctorName, + profileUrl: model.prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + appointmentDate: DateUtils.getDateTimeFromServerFormat(model.prescriptionsList[index].appointmentDate,), + orderNo: model.prescriptionsList[index].appointmentNo.toString(), + invoiceNO:model.prescriptionsList[index].appointmentNo.toString(), + ) - ], - ), - ...List.generate( - model.prescriptionsOrderList.length, - (index) => AppExpandableNotifier( - title: model - .prescriptionsOrderList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .prescriptionsOrderList[index].prescriptionsList - .map((prescriptions) { - return InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: prescriptions, - patient: patient, - ), - ), - ), - child: DoctorCard( - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - branch: prescriptions.name, - appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate,), - orderNo: prescriptions.appointmentNo.toString(), - invoiceNO:prescriptions.appointmentNo.toString(), - ) + )) - ); - }).toList(), - )), - ) ], ), ), diff --git a/lib/widgets/shared/app_button.dart b/lib/widgets/shared/app_button.dart index 984d4350..60a3528d 100644 --- a/lib/widgets/shared/app_button.dart +++ b/lib/widgets/shared/app_button.dart @@ -2,18 +2,22 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class Button extends StatefulWidget { + final String title; + final Widget icon; + final VoidCallback onTap; + final bool loading; + final Color color; + Button({ Key key, - this.title: "", + this.title = "", this.icon, this.onTap, - this.loading: false, + this.loading= false, + this.color, }) : super(key: key); - final String title; - final Widget icon; - final VoidCallback onTap; - final bool loading; + @override _ButtonState createState() => _ButtonState(); @@ -86,7 +90,8 @@ class _ButtonState extends State