From 5aa333ba2c3cb468e3dc1d58d3a0e116364b4cfe Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 25 Apr 2021 14:48:10 +0300 Subject: [PATCH 1/2] fix design --- .../profile/note/progress_note_screen.dart | 689 ++++++++++-------- 1 file changed, 394 insertions(+), 295 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index ca434fcf..e36fadd7 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -10,6 +10,7 @@ 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/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -105,318 +106,416 @@ class _ProgressNoteState extends State { child: ListView.builder( itemCount: model.patientProgressNoteList.length, itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - Container( - margin: EdgeInsets.only( - left: 10, - right: 10, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(10), - ), - padding: EdgeInsets.all(15), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authProvider.doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14):model + .patientProgressNoteList[ + index] + .status == + 4?Colors.red.shade700 + : model + .patientProgressNoteList[ + index] + .status == + 2?Colors.green[600]:Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authProvider + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( + 'Pending', + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 16, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 4) + AppText( + 'Canceled', + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 16, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 2) + AppText( + 'Verified', + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 16, + ), + if (model.patientProgressNoteList[index].status != 2 && + model + .patientProgressNoteList[ + index] + .status != + 4 && + authProvider + .doctorProfile.doctorID == + model + .patientProgressNoteList[ + index] + .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: model + .patientProgressNoteList[ + index], + patientModel: + model, + patient: + patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - if(model.patientProgressNoteList[index].status == 1 && authProvider.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) - AppText( - 'In Progress',fontWeight: FontWeight.bold, color: Color(0xFFCC9B14),fontSize: 16,), - if(model.patientProgressNoteList[index].status == 4) - AppText( - 'Canceled',fontWeight: FontWeight.bold, color: Colors.red.shade700,fontSize: 16,), - if(model.patientProgressNoteList[index].status == 2) - AppText( - 'Verified',fontWeight: FontWeight.bold, color: Colors.grey.shade700,fontSize: 16,), - if (model.patientProgressNoteList[index].status != 2 && - model.patientProgressNoteList[index].status != 4 && authProvider.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model.patientProgressNoteList[ - index], - patientModel: - model, - patient: patient, - visitType: widget - .visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: - BorderRadius.circular( - 10), + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Update', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - // color:Colors.red[600], + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: + false, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: true, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + 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( - 'Update', - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons + .check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Verify', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "cancel", - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context, - ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: - int.parse(patient - .admissionNo), - cancelledNote: true, - lineItemNo: - model.patientProgressNoteList[index] - .lineItemNo, - createdBy: - model.patientProgressNoteList[index] - .createdBy, - notes: - model.patientProgressNoteList[index] - .notes, - verifiedNote: false, - patientTypeID: patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, isLocalBusy: true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "cancel", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context, + ); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: true, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: false, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons + .trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog(context: context, actionName: "verify",confirmFun: () async{ - GifLoaderDialogUtils - .showMyDialog(context); - UpdateNoteReqModel reqModel = - UpdateNoteReqModel( - admissionNo: int.parse( - patient.admissionNo), - cancelledNote: false, - lineItemNo: model.patientProgressNoteList[index] - .lineItemNo, - createdBy: model.patientProgressNoteList[index] - .createdBy, - notes: - model.patientProgressNoteList[index].notes, - verifiedNote: true, - patientTypeID: - patient.patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, isLocalBusy: true); - GifLoaderDialogUtils - .hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Verify', - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + SizedBox( + width: 10, + ) + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + 'Created By: ', + fontSize: 10, + ), + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .doctorName ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], ), ), - SizedBox( - width: 10, - ) - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.65, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Column( children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - 'Created By: ', - fontSize: 10, - ), - Expanded( - child: AppText( - model.patientProgressNoteList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,), - ), - ], + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils.getDayMonthYearDateFormatted( + DateUtils.getDateTimeFromServerFormat( + model + .patientProgressNoteList[ + index] + .createdOn)) + : DateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils.getHour(DateUtils + .getDateTimeFromServerFormat( + model + .patientProgressNoteList[ + index] + .createdOn)) + : DateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, ), - ], - ), - ), - Column( + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - AppText( - model.patientProgressNoteList[index] - .createdOn != - null - ? DateUtils - .getDayMonthYearDateFormatted( - DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) - : DateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - model.patientProgressNoteList[index] - .createdOn != - null - ? DateUtils - .getHour( - DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn )) - : DateUtils - .getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], - crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model.patientProgressNoteList[index].notes, - fontSize: 10, + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .notes, + fontSize: 10, + ), ), - ), - ]) - ], - ), - ), - SizedBox( - height: 20, - + ]) + ], + ), + SizedBox( + height: 20, + ), + ], ), - ], + ), ); }), ), From 70e394cfc7eefeb3f36d0961221de4319ad34ede Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 25 Apr 2021 14:55:38 +0300 Subject: [PATCH 2/2] change font size --- lib/screens/patients/profile/note/progress_note_screen.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index e36fadd7..443bff8d 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -149,7 +149,7 @@ class _ProgressNoteState extends State { 'Pending', fontWeight: FontWeight.bold, color: Color(0xFFCC9B14), - fontSize: 16, + fontSize: 12, ), if (model .patientProgressNoteList[ @@ -160,7 +160,7 @@ class _ProgressNoteState extends State { 'Canceled', fontWeight: FontWeight.bold, color: Colors.red.shade700, - fontSize: 16, + fontSize: 12, ), if (model .patientProgressNoteList[ @@ -171,7 +171,7 @@ class _ProgressNoteState extends State { 'Verified', fontWeight: FontWeight.bold, color: Colors.green[600], - fontSize: 16, + fontSize: 12, ), if (model.patientProgressNoteList[index].status != 2 && model