From 3d608131464c6fbe629e2c10458085ecb8be1632 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 10 Feb 2021 15:12:26 +0200 Subject: [PATCH] bug fixing --- .../prescription/add_prescription_form.dart | 143 ++++++++++++------ .../procedures/add-procedure-form.dart | 2 +- lib/screens/procedures/procedure_screen.dart | 12 +- lib/screens/procedures/update-procedure.dart | 2 +- 4 files changed, 102 insertions(+), 57 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 80d77f3e..b1e79ae2 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -543,56 +543,101 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox(height: spaceBetweenTextFileds), - //model.patientAssessmentList.forEach((element) { }). - Column( - children: model.patientAssessmentList - .map((element) { - return Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: indicationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: indicationList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - indication = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - element.icdCode10ID - .toString(), - indication != null - ? indication['name'] - : null, - true), - enabled: true, - readOnly: true, - ), + + if (model.patientAssessmentList.isNotEmpty) + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + indication = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + model.patientAssessmentList[0] + .icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, ), - ); - }).toList(), - ), + ), + ), + //model.patientAssessmentList.forEach((element) { }). + // Column( + // children: model.patientAssessmentList + // .map((element) { + // return Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: indicationList != null + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: indicationList, + // attributeName: 'name', + // attributeValueId: 'id', + // okText: TranslationBase.of( + // context) + // .ok, + // okFunction: (selectedValue) { + // setState(() { + // indication = + // selectedValue; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: + // (BuildContext context) { + // return dialog; + // }, + // ); + // } + // : null, + // child: TextField( + // decoration: + // textFieldSelectorDecoration( + // element.icdCode10ID + // .toString(), + // indication != null + // ? indication['name'] + // : null, + // true), + // enabled: true, + // readOnly: true, + // ), + // ), + // ); + // }).toList(), + // ), SizedBox(height: spaceBetweenTextFileds), Container( diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 81452c63..0d34da6b 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -221,7 +221,7 @@ class _AddSelectedProcedureState extends State { setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular), + Text('routine'), Radio( activeColor: Color(0xFFB9382C), groupValue: selectedType, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 28906d07..dd5c2952 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -259,11 +259,11 @@ class _ProcedureScreenState extends State { ), Expanded( child: Container( - height: MediaQuery.of( - context) - .size - .height * - 0.21, + // height: MediaQuery.of( + // context) + // .size + // .height * + // 0.21, width: MediaQuery.of( context) .size @@ -312,7 +312,7 @@ class _ProcedureScreenState extends State { AppText( model.procedureList[0].entityList[index].orderType == 1 - ? 'Regular' + ? 'Routine' : 'Urgent', fontSize: 13.0, diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 3e567c1f..9239527c 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -212,7 +212,7 @@ class _UpdateProcedureWidgetState extends State { setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular), + Text('routine'), ], ), ),