From 24d13b06c50bf143129fe1737f18475e116a7bbe Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Mar 2021 02:47:20 +0200 Subject: [PATCH] Procedure update valdation --- .../prescription/update_prescription_form.dart | 1 + lib/screens/procedures/add-procedure-form.dart | 7 +++++++ lib/screens/procedures/update-procedure.dart | 12 +++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 67723cde..7892a1cd 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -731,6 +731,7 @@ class _UpdatePrescriptionFormState extends State { "strength can't be more then 4 digits "); return; } + // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) updatePrescription( newStartDate: selectedDate, newDoseStreangth: diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index d6c1b419..605bb61c 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -324,6 +324,13 @@ class _AddSelectedProcedureState extends State { .addSelectedProcedures, onPressed: () { //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } + Navigator.pop(context); postProcedure( orderType: selectedType.toString(), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 9f5d7f45..6918d9a2 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -299,11 +299,13 @@ class _UpdateProcedureWidgetState extends State { .updateProcedure .toUpperCase(), onPressed: () { - // if (entityList.isEmpty == true) { - // DrAppToastMsg.showErrorToast( - // "Fill the mandatory procedure details"); - // return; - // } + if (entityList.isEmpty == true && + widget.remarksController.text == + widget.remarks) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } Navigator.pop(context); updateProcedure( orderNo: widget.orderNo,