From 98e0e1f078766cf581111cd4dc113d90fa8c160a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 21:07:47 +0300 Subject: [PATCH 1/2] return note back --- .../profile/note/progress_note_screen.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 588c3079..25c786bf 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -376,13 +376,25 @@ class _ProgressNoteState extends State { fontSize: 14, ), ], - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, ) ], ), SizedBox( height: 8, ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: AppText( + notesList[index].notes, + fontSize: 10, + ), + ), + ]) ], ), ), From 9c2f4e6adba048f12274cf571f8f0752e1db913c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 21:35:39 +0300 Subject: [PATCH 2/2] finally fix updating state issue --- .../profile/note/progress_note_screen.dart | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 25c786bf..b6b9c195 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -71,7 +71,7 @@ class _ProgressNoteState extends State { // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileHeaderNewDesignAppBar( patient, patient.patientType.toString() ?? '0', arrivalType), - body: notesList == null || notesList.length == 0 + body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).errorNoProgressNote) : Container( @@ -94,7 +94,7 @@ class _ProgressNoteState extends State { child: Container( child: ListView.builder( - itemCount: notesList.length, + itemCount: model.patientProgressNoteList.length, itemBuilder: (BuildContext ctxt, int index) { return Column( children: [ @@ -112,8 +112,8 @@ class _ProgressNoteState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (notesList[index].status != 2 && - notesList[index].status != 4) + if (model.patientProgressNoteList[index].status != 2 && + model.patientProgressNoteList[index].status != 4) Row( crossAxisAlignment: CrossAxisAlignment.start, @@ -125,7 +125,7 @@ class _ProgressNoteState extends State { MaterialPageRoute( builder: (context) => UpdateNoteOrder( - note: notesList[ + note: model.patientProgressNoteList[ index], patientModel: model, @@ -186,13 +186,13 @@ class _ProgressNoteState extends State { .admissionNo), cancelledNote: true, lineItemNo: - notesList[index] + model.patientProgressNoteList[index] .lineItemNo, createdBy: - notesList[index] + model.patientProgressNoteList[index] .createdBy, notes: - notesList[index] + model.patientProgressNoteList[index] .notes, verifiedNote: false, patientTypeID: patient @@ -251,12 +251,12 @@ class _ProgressNoteState extends State { admissionNo: int.parse( patient.admissionNo), cancelledNote: false, - lineItemNo: notesList[index] + lineItemNo: model.patientProgressNoteList[index] .lineItemNo, - createdBy: notesList[index] + createdBy: model.patientProgressNoteList[index] .createdBy, notes: - notesList[index].notes, + model.patientProgressNoteList[index].notes, verifiedNote: true, patientTypeID: patient.patientType, @@ -334,14 +334,14 @@ class _ProgressNoteState extends State { ), Expanded( child: AppText( - notesList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,), + model.patientProgressNoteList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,), ), ], ), - if(notesList[index].status == 4) + if(model.patientProgressNoteList[index].status == 4) AppText( 'Canceled',fontWeight: FontWeight.w600, color: Colors.red.shade700,fontSize: 12,), - if(notesList[index].status == 2) + if(model.patientProgressNoteList[index].status == 2) AppText( 'verified',fontWeight: FontWeight.w600, color: Colors.grey.shade700,fontSize: 12,), ], @@ -350,12 +350,12 @@ class _ProgressNoteState extends State { Column( children: [ AppText( - notesList[index] + model.patientProgressNoteList[index] .createdOn != null ? DateUtils .getDayMonthYearDateFormatted( - DateUtils.getDateTimeFromServerFormat(notesList[index].createdOn)) + DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) : DateUtils .getDayMonthYearDateFormatted( DateTime.now()), @@ -363,12 +363,12 @@ class _ProgressNoteState extends State { fontSize: 14, ), AppText( - notesList[index] + model.patientProgressNoteList[index] .createdOn != null ? DateUtils .getHour( - DateUtils.getDateTimeFromServerFormat(notesList[index].createdOn )) + DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn )) : DateUtils .getHour( DateTime.now()), @@ -390,7 +390,7 @@ class _ProgressNoteState extends State { children: [ Expanded( child: AppText( - notesList[index].notes, + model.patientProgressNoteList[index].notes, fontSize: 10, ), ),