From 3107950f5c13eb804347874998e6b10f74f188f4 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 1 Jun 2021 17:00:24 +0300 Subject: [PATCH] fix bug --- lib/screens/procedures/ProcedureType.dart | 8 +- .../procedures/add-procedure-page.dart | 145 +++++++++--------- 2 files changed, 76 insertions(+), 77 deletions(-) diff --git a/lib/screens/procedures/ProcedureType.dart b/lib/screens/procedures/ProcedureType.dart index 4fc7781a..44ac0a9d 100644 --- a/lib/screens/procedures/ProcedureType.dart +++ b/lib/screens/procedures/ProcedureType.dart @@ -31,9 +31,9 @@ extension procedureType on ProcedureType { case ProcedureType.PROCEDURE: return TranslationBase.of(context).addProcedures; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addRadiologyOrder; - case ProcedureType.RADIOLOGY: return TranslationBase.of(context).addLabOrder; + case ProcedureType.RADIOLOGY: + return TranslationBase.of(context).addRadiologyOrder; default: return ""; } @@ -44,9 +44,9 @@ extension procedureType on ProcedureType { case ProcedureType.PROCEDURE: return TranslationBase.of(context).addProcedures; case ProcedureType.LAB_RESULT: - return TranslationBase.of(context).addRadiologyOrder; - case ProcedureType.RADIOLOGY: return TranslationBase.of(context).addLabOrder; + case ProcedureType.RADIOLOGY: + return TranslationBase.of(context).addRadiologyOrder; default: return ""; } diff --git a/lib/screens/procedures/add-procedure-page.dart b/lib/screens/procedures/add-procedure-page.dart index 65f0b2e1..3640a8dc 100644 --- a/lib/screens/procedures/add-procedure-page.dart +++ b/lib/screens/procedures/add-procedure-page.dart @@ -81,80 +81,79 @@ class _AddProcedurePageState extends State { children: [ if (procedureType == ProcedureType.PROCEDURE) Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * 0.02, + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * + 0.79, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchProcedureHere, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + // onClick: () { + // if (procedureName.text.isNotEmpty && + // procedureName.text.length >= 3) + // model.getProcedureCategory( + // patientId: patient.patientId, + // categoryName: + // procedureName.text); + // else + // DrAppToastMsg.showErrorToast( + // TranslationBase.of(context) + // .atLeastThreeCharacters, + // ); + // }, ), - ], - ), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.02, - ), - Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * - 0.79, - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchProcedureHere, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - hasBorder: true, - controller: procedureName, - // onClick: () { - // if (procedureName.text.isNotEmpty && - // procedureName.text.length >= 3) - // model.getProcedureCategory( - // patientId: patient.patientId, - // categoryName: - // procedureName.text); - // else - // DrAppToastMsg.showErrorToast( - // TranslationBase.of(context) - // .atLeastThreeCharacters, - // ); - // }, + ), + SizedBox( + width: MediaQuery.of(context).size.width * + 0.02, + ), + Expanded( + child: InkWell( + onTap: () { + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + patientId: patient.patientId, + categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); + }, + child: Icon( + Icons.search, + size: 25.0, ), ), - SizedBox( - width: MediaQuery.of(context).size.width * - 0.02, - ), - Expanded( - child: InkWell( - onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) - model.getProcedureCategory( - patientId: patient.patientId, - categoryName: - procedureName.text); - else - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, - ); - }, - child: Icon( - Icons.search, - size: 25.0, - ), - ), - ), - ], - ), - ], - ), + ), + ], + ), + ], + ), if (procedureName.text.isNotEmpty && model.categoriesList.length != 0) NetworkBaseView( @@ -205,12 +204,12 @@ class _AddProcedurePageState extends State { return; } - Navigator.pop(context); - await model.preparePostProcedure( + await this.model.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, remarks: remarksController.text); + Navigator.pop(context); }, ), ],