From d1060ba27a497c74be09428160f1db8c9dd2e611 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 25 Nov 2021 09:57:38 +0200 Subject: [PATCH] small fixes --- lib/config/localized_values.dart | 2 + .../operation_report/operation_report.dart | 578 +++++++++--------- lib/util/translations_delegate_base.dart | 2 + 3 files changed, 306 insertions(+), 276 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a4eb5dbc..51b2e2c1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -711,6 +711,8 @@ const Map> localizedValues = { "special": {"en": "Special", "ar": "خاص"}, "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} , "operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}, + "reports": {"en": "Reports", "ar": "تقارير "}, + "operation": {"en": "Operation", "ar": " العملية"}, "registerNewPatient": {"en": "Register\nNew Patient", "ar": "تسجيل\n مريض جديد"}, "registeraPatient": {"en": "Register a Patient", "ar": "تسجيل المريض"}, "occupation": {"en": "Occupation", "ar": "مهنة"}, diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 63aaf458..34b43315 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -67,304 +67,330 @@ class _ProgressNoteState extends State { ), body: Container( color: Colors.grey[200], - child: Column( - children: [ - model.reservationList == null || - model.reservationList.length == 0 - ? Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, ), - ): Expanded( - child: Container( - child: ListView.builder( - itemCount: model.reservationList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: Colors.white, - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + child:model.reservationList == null || + model.reservationList.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, ), + ): Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).operation, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).reports, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.reservationList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: Colors.white, + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .createdBy, - fontSize: 10, - ), - Expanded( - child: AppText( - model - .reservationList[ - index] - .doctorName ?? - '', - fontWeight: - FontWeight.w600, - fontSize: 12, - ), - ), - ], - ), - ], - ), - ), - Column( - children: [ - AppText( - model - .reservationList[ - index] - .createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - model - .reservationList[ - index] - .createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], + Row( crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Reservation: ", - fontSize: 10, - ), - Expanded( - child: AppText( - model.reservationList[index].oTReservationID.toString(), - fontSize: 10, - ), - ) - ]), - SizedBox( - height: 8, - ), - if (model.reservationList[index] - .operationDate != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, + CrossAxisAlignment + .start, children: [ AppText( - "Operation Date : ", - fontSize: 10, - ), - Expanded( - child: AppText( - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .reservationList[ - index] - .operationDate), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true), - fontSize: 10, - ), - ) - ]), - if (model.reservationList[index] - .timeStart != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Operation Time Start : ", + TranslationBase.of( + context) + .createdBy, fontSize: 10, ), Expanded( child: AppText( model .reservationList[ - index] - .timeStart, - fontSize: 10, - ), - ) - ]), - if (model.reservationList[index] - .remarks != - null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Remarks : ", - fontSize: 10, - ), - Expanded( - child: AppText( - model - .reservationList[ - index] - .remarks ?? + index] + .doctorName ?? '', - fontSize: 10, + fontWeight: + FontWeight.w600, + fontSize: 12, ), ), - ]) - ], - ), - - SizedBox( - height: 20, - ), - - // if ( - // authenticationViewModel - // .doctorProfile.doctorID == - // model - // .operationReportList[ - // index] - // .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model + .reservationList[ + index] + .createdOn != + null + ? AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true) + : AppDateUtils + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model + .reservationList[ + index] + .createdOn != + null + ? AppDateUtils.getHour( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .createdOn)) + : AppDateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( mainAxisAlignment: - MainAxisAlignment.end, + MainAxisAlignment.start, children: [ - InkWell( - onTap: () async { - await locator() - .logEvent( - eventCategory: - "Operation Report Screen", - eventAction: - "Update Operation Report ", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateOperationReport( - reservation: model - .reservationList[ - index], - patient: patient, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: - BorderRadius.circular(10), + AppText( + "Reservation: ", + fontSize: 10, + ), + Expanded( + child: AppText( + model.reservationList[index].oTReservationID.toString(), + fontSize: 10, + ), + ) + ]), + SizedBox( + height: 8, + ), + if (model.reservationList[index] + .operationDate != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Date : ", + fontSize: 10, + ), + Expanded( + child: AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .reservationList[ + index] + .operationDate), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontSize: 10, ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - "Operation Reports", - fontSize: 10, - color: Colors.white, - ), - ], + ) + ]), + if (model.reservationList[index] + .timeStart != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Time Start : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .timeStart, + fontSize: 10, ), - padding: EdgeInsets.all(6), + ) + ]), + if (model.reservationList[index] + .remarks != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Remarks : ", + fontSize: 10, ), - ), - SizedBox( - width: 10, - ), - SizedBox( - width: 10, - ), - ], - ), + Expanded( + child: AppText( + model + .reservationList[ + index] + .remarks ?? + '', + fontSize: 10, + ), + ), + ]) + ], + ), - SizedBox( - height: 10, + SizedBox( + height: 20, + ), + + // if ( + // authenticationViewModel + // .doctorProfile.doctorID == + // model + // .operationReportList[ + // index] + // .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () async { + await locator() + .logEvent( + eventCategory: + "Operation Report Screen", + eventAction: + "Update Operation Report ", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateOperationReport( + reservation: model + .reservationList[ + index], + patient: patient, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + "Operation Reports", + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - ], - ), + ), + SizedBox( + width: 10, + ), + SizedBox( + width: 10, + ), + ], ), - ); - }), - ), - ), + + SizedBox( + height: 10, + ), + ], + ), + ), + ); + }), + ), + ), ], ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 397f8b36..647cf39f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -213,6 +213,8 @@ class TranslationBase { String get progressNote => localizedValues['progressNote'][locale.languageCode]; String get operationReports => localizedValues['operationReports'][locale.languageCode]; + String get reports => localizedValues['reports'][locale.languageCode]; + String get operation => localizedValues['operation'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode];