From 494f716f0524059b1dff0bc994273a0831e52ca7 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 5 Apr 2021 12:53:26 +0300 Subject: [PATCH 1/3] working on new design on vital sign and referral screens --- .../patient-doctor-referral-service.dart | 2 +- .../referral/my-referral-detail-screen.dart | 40 ++- .../referral/patient_referral_screen.dart | 4 +- .../profile/vital_sign/LineChartCurved.dart | 60 ++-- .../LineChartCurvedBloodPressure.dart | 119 ++++--- ...al_sign_details_blood_pressurewideget.dart | 163 ++++++--- .../vital_sign/vital_sign_details_screen.dart | 325 +++++++++--------- .../vital_sign_details_wideget.dart | 129 ++++--- .../vital_sign_item_details_screen.dart | 120 +++++-- .../vital_sing_chart_and_detials.dart | 81 ++++- .../vital_sing_chart_blood_pressure.dart | 84 ++++- ...ent-profile-header-new-design-app-bar.dart | 6 +- 12 files changed, 706 insertions(+), 427 deletions(-) diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 3136b549..787aecae 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -156,7 +156,7 @@ class PatientReferralService extends LookupService { hasError = false; DoctorProfileModel doctorProfile = await getDoctorProfile(); Map body = Map(); - body['ClinicID'] = 0; + // body['ClinicID'] = 0; body['DoctorID'] = doctorProfile.doctorID; await baseAppClient.post( diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index d828ec23..a4510907 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -209,16 +209,38 @@ class MyReferralDetailScreen extends StatelessWidget { ), ], ) - : Container( - child: Center( - child: AppText( - TranslationBase.of(context).patientNoDetailErrMsg, - color: HexColor("#B8382B"), - fontWeight: FontWeight.bold, - fontSize: 16, - ), + : Column( + 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), + ), + Expanded( + child: AppText("" , + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + ), + ]), ), - ), + Container( + child: Center( + child: AppText( + TranslationBase.of(context).patientNoDetailErrMsg, + color: HexColor("#B8382B"), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + ), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index adea0247..16084342 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -39,11 +39,11 @@ class _PatientReferralScreen extends State extendBodyBehindAppBar: true, // backgroundColor: Colors.white, appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), + preferredSize: Size.fromHeight(60.0), child: Center( child: Container( height: 60.0, - margin: EdgeInsets.only(top: 10.0), + // margin: EdgeInsets.only(top: 10.0), width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart index 2f0eafcb..6e9c425e 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; @@ -23,36 +25,40 @@ class LineChartCurved extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(18)), // color: Colors.white, ), - child: Stack( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox( - height: 4, - ), - Text( - title, - style: TextStyle( - color: Colors.black, - fontSize: 15, - letterSpacing: 2), - textAlign: TextAlign.center, - ), - SizedBox(height: 10,), - Expanded( - child: Padding( - padding: const EdgeInsets.only(right: 18.0, left: 16.0), - child: LineChart( - sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), - ), + const SizedBox( + height: 4, + ), + Container( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + textAlign: TextAlign.center, ), + ], + ), + ), + SizedBox(height: 16,), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), ), - const SizedBox( - height: 10, - ), - ], + ), + ), + const SizedBox( + height: 10, ), ], ), diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index e816c145..ecc0f134 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -26,71 +27,77 @@ class LineChartCurvedBloodPressure extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(18)), // color: Colors.white, ), - child: Stack( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox( - height: 15, - ), - Text( - title, - style: TextStyle( - color: Colors.black, fontSize: 15, letterSpacing: 2), - textAlign: TextAlign.center, - ), - SizedBox( - height: 10, - ), - Expanded( - child: Padding( - padding: - const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), - child: LineChart( - sampleData1(context), - swapAnimationDuration: const Duration(milliseconds: 250), - ), + const SizedBox( + height: 4, + ), + Container( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + textAlign: TextAlign.center, ), + ], + ), + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), ), - SizedBox( - height: 10, - ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, children: [ - Row( - children: [ - Container( - width: 20, - height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Theme.of(context).primaryColor), - ), - SizedBox(width: 5,), - AppText(TranslationBase.of(context).systolicLng) - ], + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), ), - SizedBox(width: 15,), - Row( - children: [ - Container( - width: 20, - height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.grey), - ), - SizedBox(width: 5,), - AppText(TranslationBase.of(context).diastolicLng) - ], + SizedBox(width: 5,), + AppText(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox(width: 15,), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.grey), ), + SizedBox(width: 5,), + AppText(TranslationBase.of(context).diastolicLng) ], - ) + ), ], - ), + ) ], ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index 693507bb..78293f31 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -1,3 +1,4 @@ +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/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; @@ -17,7 +18,13 @@ class VitalSignBloodPressureWidget extends StatefulWidget { final String viewKey2; VitalSignBloodPressureWidget( - {Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2}); + {Key key, + this.vitalList, + this.title1, + this.title2, + this.viewKey1, + this.title3, + this.viewKey2}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -28,21 +35,96 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - decoration: BoxDecoration( + /*decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), border: Border.all(color: Colors.grey, width: 1), - ), - margin: EdgeInsets.all(20), + ),*/ + margin: EdgeInsets.all(0), child: Container( color: Colors.transparent, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + Expanded( + child: Container( + child: Container( + padding: EdgeInsets.all(8), + /*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: AppText( + TranslationBase.of(context).date, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60, + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + widget.title2, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + widget.title3, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ), + ], + ), + const Divider( + height: 1, + thickness: 1, + color: Colors.black, + ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -54,36 +136,7 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; - tableRow.add(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: AppText( - TranslationBase.of(context).date, - color: Colors.white, - ), - ), - height: 60, - ), - ), - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - - ), - child: Center( - child: AppText(widget.title2, color: Colors.white), - ), - height: 60), - ), + /* tableRow.add(TableRow(children: [ Container( child: Container( decoration: BoxDecoration( @@ -98,22 +151,24 @@ class _VitalSignDetailsWidgetState extends State { ), height: 60), ), - ])); + ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( child: Container( padding: EdgeInsets.all(10), color: Colors.white, - child: Center( - child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', - textAlign: TextAlign.center, - ), + child: AppText( + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), @@ -121,11 +176,13 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(10), color: Colors.white, - child: Center( - child: AppText( - '${vital.toJson()[widget.viewKey1]}', - textAlign: TextAlign.center, - ), + child: AppText( + '${vital.toJson()[widget.viewKey1]}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), @@ -133,11 +190,13 @@ class _VitalSignDetailsWidgetState extends State { child: Container( padding: EdgeInsets.all(10), color: Colors.white, - child: Center( - child: AppText( - '${vital.toJson()[widget.viewKey2]}', - textAlign: TextAlign.center, - ), + child: AppText( + '${vital.toJson()[widget.viewKey2]}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index f43975ec..23eff3a9 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -39,7 +39,7 @@ class VitalSignDetailsScreen extends StatelessWidget { builder: (_, mode, widget) => AppScaffold( isShowAppBar: false, baseViewModel: mode, - /* appBar: PatientProfileHeaderWhitAppointmentAppBar( + /* appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -140,7 +140,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png', height: - MediaQuery.of(context).size.height * 0.10, + MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -176,7 +176,7 @@ class VitalSignDetailsScreen extends StatelessWidget { ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png', height: - MediaQuery.of(context).size.height * 0.10, + MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -203,75 +203,75 @@ class VitalSignDetailsScreen extends StatelessWidget { )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 4 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 4 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - AppText( - "${TranslationBase.of(context).bmiObese}", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - AppText( - "(30-34.9)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - ], - )), + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiObese}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(30-34.9)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + ], + )), Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - mode.getBMIStatus() != 5 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 5 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, - ), - const SizedBox( - height: 4, - ), - FittedBox( - fit: BoxFit.fitWidth, - child: AppText( - "${TranslationBase.of(context).bmiObeseExtreme} fdsd", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - ), - AppText( - "(35<)", - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.15, - fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, - ), - ], - )), + ), + const SizedBox( + height: 4, + ), + FittedBox( + fit: BoxFit.fitWidth, + child: AppText( + "${TranslationBase.of(context).bmiObeseExtreme}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ), + AppText( + "(35<)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.15, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 5 + ? Color(0XFFD02127) + : null, + ), + ], + )), ], ) ], @@ -280,7 +280,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 8.0), - child : GridView.count( + child: GridView.count( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 4, @@ -291,24 +291,25 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: - TranslationBase.of(context) - .height, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: + TranslationBase.of(context).height, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).height, - imagePath: - "${assetBasePath}height.png", + imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, unit: TranslationBase.of(context).cm, ), @@ -317,18 +318,20 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: - TranslationBase.of(context) - .weight, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: + TranslationBase.of(context).weight, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( des: TranslationBase.of(context).weight, @@ -340,26 +343,25 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.Temperature, - pageTitle: - TranslationBase.of(context) - .temperature, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context) + .temperature, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: Container( child: VitalSignItem( - des: - TranslationBase.of(context).temperature, - imagePath: - "${assetBasePath}temperature.png", + des: TranslationBase.of(context).temperature, + imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, unit: TranslationBase.of(context).tempC, ), @@ -368,23 +370,24 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: - TranslationBase.of(context) - .heart, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: + TranslationBase.of(context).heart, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( des: TranslationBase.of(context).heart, - imagePath: - "${assetBasePath}heart_rate.png", + imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, unit: TranslationBase.of(context).bpm, ), @@ -392,52 +395,50 @@ class VitalSignDetailsScreen extends StatelessWidget { InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.Respiration, - pageTitle: - TranslationBase.of(context) - .respirationRate, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context) + .respirationRate, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .respirationRate, - imagePath: - "${assetBasePath}respiration_rate.png", + des: TranslationBase.of(context).respirationRate, + imagePath: "${assetBasePath}respiration_rate.png", lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context) - .respirationSigns, + unit: + TranslationBase.of(context).respirationSigns, ), ), InkWell( onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.BloodPressure, - pageTitle: - TranslationBase.of(context) - .bloodPressure, - vitalList: - mode.patientVitalSignsHistory, - ), - ), - ) + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context) + .bloodPressure, + vitalList: + mode.patientVitalSignsHistory, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), + ) : null, child: VitalSignItem( - des: - TranslationBase.of(context).bloodPressure, - imagePath: - "${assetBasePath}blood_pressure.png", + des: TranslationBase.of(context).bloodPressure, + imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, unit: TranslationBase.of(context).sysDias, ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index 11a24e42..65122b31 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -1,3 +1,4 @@ +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/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; @@ -27,21 +28,74 @@ class _VitalSignDetailsWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - decoration: BoxDecoration( + /*decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), border: Border.all(color: Colors.grey, width: 1), - ), - margin: EdgeInsets.all(20), + ),*/ + margin: EdgeInsets.all(0), child: Container( color: Colors.transparent, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + children: [ + Expanded( + child: Container( + child: Container( + padding: EdgeInsets.all(8), + /*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: AppText( + TranslationBase.of(context).date, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60, + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(8), + child: Container( + /*decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ),*/ + child: AppText( + widget.title2, + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + // height: 60 + ), + ), + ) + ], + ), + const Divider( + height: 1, + thickness: 1, + color: Colors.black, + ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]), ), children: fullData(projectViewModel), ), @@ -53,67 +107,40 @@ class _VitalSignDetailsWidgetState extends State { List fullData(ProjectViewModel projectViewModel) { List tableRow = []; - tableRow.add(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: AppText( - TranslationBase.of(context).date, - color: Colors.white, - ), - ), - height: 60, - ), - ), - Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) - ), - ), - child: Center( - child: AppText(widget.title2, color: Colors.white), - ), - height: 60), - ) - ])); + /* tableRow.add(TableRow(children: [ + + ]));*/ widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; DateTime elementDate = - DateUtils.getDateTimeFromServerFormat(vital.createdOn); + DateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( child: Container( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(8), color: Colors.white, - child: Center( - child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', - textAlign: TextAlign.center, - ), + child: AppText( + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), Container( child: Container( - padding: EdgeInsets.all(10), + padding: EdgeInsets.all(8), color: Colors.white, - child: Center( - child: AppText( - '${vital.toJson()[widget.viewKey]}', - textAlign: TextAlign.center, - ), + child: AppText( + '${vital.toJson()[widget.viewKey]}', + // textAlign: TextAlign.center, + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w600, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', ), ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index bd828138..349120f4 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1,10 +1,15 @@ +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/lookups/patient_lookup.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -12,8 +17,17 @@ class VitalSignItemDetailsScreen extends StatelessWidget { final vitalSignDetails pageKey; final String pageTitle; List VSchart; - - VitalSignItemDetailsScreen({this.vitalList, this.pageKey, this.pageTitle}); + PatiantInformtion patient; + String patientType; + String arrivalType; + + VitalSignItemDetailsScreen( + {this.vitalList, + this.pageKey, + this.pageTitle, + this.patient, + this.patientType, + this.arrivalType}); final List vitalList; @@ -31,7 +45,6 @@ class VitalSignItemDetailsScreen extends StatelessWidget { 'title2Ar': 'الكتلة', 'viewKey': 'BodyMassIndex', }, - ]; break; @@ -87,7 +100,6 @@ class VitalSignItemDetailsScreen extends StatelessWidget { 'title3Ar': 'الإنبساط', 'viewKey': 'BloodPressure', }, - ]; break; @@ -161,35 +173,79 @@ class VitalSignItemDetailsScreen extends StatelessWidget { } return AppScaffold( appBarTitle: pageTitle, + backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, - body: ListView( - children: VSchart.map((chartInfo) { - var vitalListTemp = vitalList.where( - (element) => element.toJson()[chartInfo['viewKey']] != null, - ); - - if(vitalListTemp.length != 0 && chartInfo['viewKey']=='BloodPressure'){ - return VitalSingChartBloodPressure( - vitalList: vitalList, - name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], - title1: chartInfo['title1'], - title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], - title3:projectViewModel.isArabic?chartInfo['title3Ar']: chartInfo['title3'], - viewKey1: 'BloodPressureHigher', - viewKey2: 'BloodPressureLower', - - ); - } - - return vitalListTemp.length != 0 - ? VitalSingChartAndDetials( - vitalList: vitalList, - name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], - title1: chartInfo['title1'], - title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], - viewKey: chartInfo['viewKey']) - : Container(); - }).toList(), + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${patient.firstName ?? patient.patientDetails.firstName}'s", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, + ), + AppText( + TranslationBase.of(context).vitalSign, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + Container( + child: ListView( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + children: VSchart.map((chartInfo) { + var vitalListTemp = vitalList.where( + (element) => element.toJson()[chartInfo['viewKey']] != null, + ); + + if (vitalListTemp.length != 0 && + chartInfo['viewKey'] == 'BloodPressure') { + return VitalSingChartBloodPressure( + vitalList: vitalList, + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], + title1: chartInfo['title1'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], + title3: projectViewModel.isArabic + ? chartInfo['title3Ar'] + : chartInfo['title3'], + viewKey1: 'BloodPressureHigher', + viewKey2: 'BloodPressureLower', + ); + } + + return vitalListTemp.length != 0 + ? VitalSingChartAndDetials( + vitalList: vitalList, + name: projectViewModel.isArabic + ? chartInfo['nameAr'] + : chartInfo['name'], + title1: chartInfo['title1'], + title2: projectViewModel.isArabic + ? chartInfo['title2Ar'] + : chartInfo['title2'], + viewKey: chartInfo['viewKey']) + : Container(); + }).toList(), + ), + ), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index fbc0f3e1..0fe640ff 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart'; @@ -32,9 +33,52 @@ class VitalSingChartAndDetials extends StatelessWidget { @override Widget build(BuildContext context) { generateData(); - return timeSeriesData.length != 0 ? Column( - children: [ - AppExpandableNotifier( + return timeSeriesData.length != 0 + ? Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: LineChartCurved( + title: name, + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Graph Details", + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + SizedBox(height: 8,), + VitalSignDetailsWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + viewKey: viewKey, + ), + ], + ), + ), + /*AppExpandableNotifier( // isExpand: true, headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), bodyWid: VitalSignDetailsWidget( @@ -43,26 +87,31 @@ class VitalSingChartAndDetials extends StatelessWidget { title2: title2, viewKey: viewKey, ), - ), - ], - ) : Container( - width: double.infinity, - height: MediaQuery.of(context).size.height, - child: Center( - child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), - ), - ); + ),*/ + ], + ), + ) + : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + child: Center( + child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), + ), + ); } generateData() { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( - (element) { - DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn); - if(element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) + (element) { + DateTime elementDate = + DateUtils.getDateTimeFromServerFormat(element.createdOn); + if (element.toJson()[viewKey] != null && + element.toJson()[viewKey]?.toInt() != 0) timeSeriesData.add( TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey].toDouble(), ), ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index dd9f940f..e424bc72 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -1,9 +1,11 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; @@ -36,26 +38,72 @@ class VitalSingChartBloodPressure extends StatelessWidget { @override Widget build(BuildContext context) { generateData(); - return Column( - children: [ - AppExpandableNotifier( - // isExpand: true, - headerWid: LineChartCurvedBloodPressure( - title: name, - timeSeries1: timeSeriesData1, - timeSeries2: timeSeriesData2, - indexes: timeSeriesData1.length ~/ 5.5, + return Padding( + padding: const EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), ), - bodyWid: VitalSignBloodPressureWidget( - vitalList: vitalList, - title1: title1, - title2: title2, - title3: title3, - viewKey1: viewKey1, - viewKey2: viewKey2, + Container( + margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16), + padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "Graph Details", + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.black, + fontFamily: 'Poppins', + ), + SizedBox(height: 8,), + VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ], + ), ), - ), - ], + /*AppExpandableNotifier( + // isExpand: true, + headerWid: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + bodyWid: VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ),*/ + ], + ), ); } diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 195f6447..6e0192a8 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -44,7 +44,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with Preferred onPressed: () => Navigator.pop(context), ), AppText( - patient.firstName!=null? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)):'', + patient.firstName != null ? + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, From 5dcc875a0a37134481223143ad346dcaac413138 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 5 Apr 2021 13:01:08 +0300 Subject: [PATCH 2/3] first step from design of subject page and ExpandableSOAPWidget --- .../soap_update/expandable_SOAP_widget.dart | 61 +++++ .../subjective/update_subjective_page.dart | 241 ++++++++---------- .../soap_update/update_soap_index.dart | 66 +++-- 3 files changed, 204 insertions(+), 164 deletions(-) create mode 100644 lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart diff --git a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart new file mode 100644 index 00000000..24a69a0b --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -0,0 +1,61 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ExpandableSOAPWidget extends StatelessWidget { + final bool isExpanded; + final Widget child; + final Function onTap; + final headerTitle; + + const ExpandableSOAPWidget( + {Key key, this.isExpanded, this.child, this.onTap, this.headerTitle}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric(vertical: 20, horizontal: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts(headerTitle, + variant: isExpanded ? "bodyText" : '', + bold: isExpanded ? true : false, + fontSize: 20, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: onTap, + child: Icon( + isExpanded ? EvaIcons.arrowIosUpwardOutline: EvaIcons.arrowIosDownwardOutline)) + ], + ), + bodyWidget: child, + isExpand: isExpanded, + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 3bc89a7f..c8ac819d 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; @@ -20,14 +19,13 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../expandable_SOAP_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -220,6 +218,9 @@ class _UpdateSubjectivePageState extends State { }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), @@ -232,46 +233,31 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase.of(context).chiefComplaints.toUpperCase(), - variant: isChiefExpand ? "bodyText" : '', - bold: isChiefExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isChiefExpand = !isChiefExpand; - }); - }, - child: Icon( - isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) - ], - ), - bodyWidget: Form( + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .chiefComplaints + .toUpperCase(), + onTap: () { + setState(() { + isChiefExpand = !isChiefExpand; + }); + }, + child: Form( key: formKey, child: Column(children: [ SizedBox( height: 20, ), Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hasLabelText: complaintsController.text != '' ? true : false, - hintText: TranslationBase.of(context) + hintText: TranslationBase + .of(context) .addChiefComplaints, fontSize: 13.5, // hintColor: Colors.black, @@ -297,11 +283,11 @@ class _UpdateSubjectivePageState extends State { height: 20, ), Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hasLabelText: illnessController.text != '' - ? true - : false, + hasLabelText: + illnessController.text != '' ? true : false, showLabelText: true, hintText: TranslationBase .of(context) @@ -326,12 +312,15 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - UpdateMedicationWidget(medicationController: medicationController,), + UpdateMedicationWidget( + medicationController: medicationController, + ), SizedBox( height: 10, ), Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hasLabelText: medicationController.text != '' ? true @@ -358,117 +347,94 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - ]), ), - isExpand: isChiefExpand, - ), - - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + isExpanded: isChiefExpand, ), SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .histories - .toUpperCase(), - variant: isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column( + + + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .histories + .toUpperCase(), + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Column( children: [ UpdateHistoryWidget(myHistoryList: widget.myHistoryList) ], ), - isExpand: isHistoryExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + isExpanded: isHistoryExpand, ), SizedBox( height: 30, ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts(TranslationBase - .of(context) - .allergiesSoap - .toUpperCase(), - variant: isAllergiesExpand ? "bodyText" : '', - bold: isAllergiesExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Icon(isAllergiesExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget:Column( + + + ExpandableSOAPWidget( + headerTitle: TranslationBase + .of(context) + .allergiesSoap + .toUpperCase(), + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Column( children: [ - UpdateAllergiesWidget(myAllergiesList: widget.myAllergiesList,), + UpdateAllergiesWidget(myAllergiesList: widget + .myAllergiesList,), SizedBox( height: 30, ), ], - ) - , - isExpand: isAllergiesExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), + ), + isExpanded: isAllergiesExpand, ), SizedBox( - height: 30, + height:MediaQuery.of(context).size.height * 0.2, ), - AppButton( - title: TranslationBase.of(context).next, + ], + ), + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), + ), + height: MediaQuery + .of(context) + .size + .height * 0.15, + width: double.infinity, + + child: Column( + children: [ + SizedBox( + height: 15, + ), + Container(child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + title: TranslationBase + .of(context) + .next, loading: model.state == ViewState.BusyLocal, onPressed: () async { addSubjectiveInfo( @@ -477,11 +443,13 @@ class _UpdateSubjectivePageState extends State { myHistoryList: widget.myHistoryList); }, ), - ], + ), + ),), + SizedBox( + height: 15, ), - ), - ), - ), + ], + ),), ), ); } @@ -624,12 +592,13 @@ class _UpdateSubjectivePageState extends State { numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { // TODO: make it postChiefComplaint after it start to work - postChiefComplaintRequestModel.editedBy=''; + postChiefComplaintRequestModel.editedBy = ''; await model.postChiefComplaint(postChiefComplaintRequestModel); } else { await model.patchChiefComplaint(postChiefComplaintRequestModel); } } - } } + + diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 5c646121..95d03cec 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -6,8 +6,6 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.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-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; @@ -17,11 +15,13 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../patient-profile-header-new-design.dart'; class UpdateSoapIndex extends StatefulWidget { final bool isUpdate; const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + @override _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); } @@ -65,30 +65,39 @@ class _UpdateSoapIndexState extends State builder: (_, model, w) => AppScaffold( // baseViewModel: model, isLoading: _isLoading, - appBarTitle: TranslationBase.of(context).healthRecordInformation, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).healthRecordInformation, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - decoration: - BoxDecoration(boxShadow: [], color: Colors.white), + decoration: BoxDecoration( + boxShadow: [], + color: Theme.of(context).scaffoldBackgroundColor), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), + // PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign(patient, '7', '7'), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), FractionallySizedBox( child: SingleChildScrollView( child: Container( + color: Theme.of(context).scaffoldBackgroundColor, height: MediaQuery.of(context).size.height * 0.75, child: Column( children: [ Container( margin: EdgeInsets.only( - left: - MediaQuery.of(context).size.width * 0.05, - right: - MediaQuery.of(context).size.width * 0.05), + left: MediaQuery.of(context).size.width * + 0.05, + right: MediaQuery.of(context).size.width * + 0.05), child: StepsWidget( index: _currentIndex, changeCurrentTab: changePageViewIndex, @@ -96,6 +105,7 @@ class _UpdateSoapIndexState extends State ), Expanded( child: PageView( + physics: NeverScrollableScrollPhysics(), controller: _controller, onPageChanged: (index) { @@ -106,32 +116,32 @@ class _UpdateSoapIndexState extends State scrollDirection: Axis.horizontal, children: [ UpdateSubjectivePage( - changePageViewIndex: changePageViewIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdateObjectivePage( - changePageViewIndex: changePageViewIndex, - mySelectedExamination: - mySelectedExamination, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + mySelectedExamination: + mySelectedExamination, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdateAssessmentPage( - changePageViewIndex: changePageViewIndex, - mySelectedAssessmentList: - mySelectedAssessment, - patientInfo: patient, - changeLoadingState:changeLoadingState + changePageViewIndex: changePageViewIndex, + mySelectedAssessmentList: + mySelectedAssessment, + patientInfo: patient, + changeLoadingState: changeLoadingState ), UpdatePlanPage( - changePageViewIndex: changePageViewIndex, - patientInfo: patient, + changePageViewIndex: changePageViewIndex, + patientInfo: patient, patientProgressNote: patientProgressNote, - changeLoadingState:changeLoadingState + changeLoadingState: changeLoadingState ) ], From 5309ace62ef89bbde7ddb465139a1c2a63bb1226 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 5 Apr 2021 13:02:01 +0300 Subject: [PATCH 3/3] sick leave --- lib/config/config.dart | 5 +- lib/screens/sick-leave/add-sickleave.dart | 141 +++++++++++---------- lib/screens/sick-leave/show-sickleave.dart | 1 + 3 files changed, 76 insertions(+), 71 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f402bea2..06768cbc 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -121,7 +121,7 @@ const GET_DASHBOARD = const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; + 'Services/DoctorApplication.svc/REST/PatientArrivalList​'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; @@ -143,6 +143,9 @@ const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; +const GET_PATIENT_ARRIVAL_LIST = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; + ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 1297a673..5c0ad3f4 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -230,76 +230,77 @@ class AddSickLeavScreen extends StatelessWidget { )); }).toList(), ) - : new Builder(builder: (context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patient, - fontWeight: FontWeight.bold, - ), - AppText( - TranslationBase.of(context).sickLeave, - fontSize: 24, - fontWeight: FontWeight.bold, - ), - ], - )), - Container( - width: SizeConfig.screenWidth, - margin: EdgeInsets.only( - left: 20, right: 20, top: 20, bottom: 20), - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: HexColor('#EAEAEA')), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: Container( - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: - BorderRadius.circular(10)), - padding: EdgeInsets.all(3), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - color: Colors.white, - ), - onPressed: () { - openSickLeave( - context, - false, - ); - }), - )), - Padding( - child: AppText( - TranslationBase.of(context) - .noSickLeaveApplied, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 16, - textAlign: TextAlign.center, - color: HexColor('#7E7E7E')), - padding: EdgeInsets.all(10), - ), - ], - )), - SizedBox( - height: SizeConfig.screenHeight * .6, - ) - ], - ); - }), + : SizedBox() + // : new Builder(builder: (context) { + // return Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: EdgeInsets.all(10), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).patient, + // fontWeight: FontWeight.bold, + // ), + // AppText( + // TranslationBase.of(context).sickLeave, + // fontSize: 24, + // fontWeight: FontWeight.bold, + // ), + // ], + // )), + // Container( + // width: SizeConfig.screenWidth, + // margin: EdgeInsets.only( + // left: 20, right: 20, top: 20, bottom: 20), + // padding: EdgeInsets.all(20), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + // color: HexColor('#EAEAEA')), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Container( + // child: Container( + // decoration: BoxDecoration( + // color: Colors.grey, + // borderRadius: + // BorderRadius.circular(10)), + // padding: EdgeInsets.all(3), + // child: IconButton( + // icon: Icon( + // Icons.add, + // size: 35, + // color: Colors.white, + // ), + // onPressed: () { + // openSickLeave( + // context, + // false, + // ); + // }), + // )), + // Padding( + // child: AppText( + // TranslationBase.of(context) + // .noSickLeaveApplied, + // fontWeight: FontWeight.bold, + // fontFamily: 'Poppins', + // fontSize: 16, + // textAlign: TextAlign.center, + // color: HexColor('#7E7E7E')), + // padding: EdgeInsets.all(10), + // ), + // ], + // )), + // SizedBox( + // height: SizeConfig.screenHeight * .6, + // ) + // ], + // ); + // }), ])))); } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 52ec7094..f64147dc 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -30,6 +30,7 @@ class ShowSickLeaveScreen extends StatelessWidget { model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).sickleave, body: SingleChildScrollView( child: Column(