From 444ad269ae088ac49906f86a34d00a990ef1d5bf Mon Sep 17 00:00:00 2001 From: yaso-meth Date: Mon, 12 Aug 2024 17:16:31 +0200 Subject: [PATCH] update queue date field to be reuired. update searchfield to not submit when nothing is entered. --- .../patient_manager/lib/components/buildPatientList.dart | 7 ++++--- .../patient_manager/lib/components/mySearchInput.dart | 8 +++++--- Frontend/patient_manager/lib/components/prescipInput.dart | 1 - Frontend/patient_manager/lib/pages/patientManager.dart | 5 ++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Frontend/patient_manager/lib/components/buildPatientList.dart b/Frontend/patient_manager/lib/components/buildPatientList.dart index ab0214a8..798e149e 100644 --- a/Frontend/patient_manager/lib/components/buildPatientList.dart +++ b/Frontend/patient_manager/lib/components/buildPatientList.dart @@ -69,9 +69,10 @@ class _BuildPatientsListState extends State { ), onTap: () { setState(() { - Navigator.of(context).pushNamed('/patient-manager/patient', - arguments: PatientViewArguments( - widget.signedInUser, widget.patients[index], "business")); + // Add popup to add patienmt to queue + // Navigator.of(context).pushNamed('/patient-manager/patient', + // arguments: PatientViewArguments( + // widget.signedInUser, widget.patients[index], "business")); }); }, trailing: Icon( diff --git a/Frontend/patient_manager/lib/components/mySearchInput.dart b/Frontend/patient_manager/lib/components/mySearchInput.dart index a0ad7ee7..f6163dc6 100644 --- a/Frontend/patient_manager/lib/components/mySearchInput.dart +++ b/Frontend/patient_manager/lib/components/mySearchInput.dart @@ -6,14 +6,12 @@ class MySearchField extends StatefulWidget { final String hintText; final bool required; final bool editable; - final void Function(String)? onChanged; final void Function() onTap; const MySearchField({ super.key, required this.controller, required this.hintText, - required this.onChanged, required this.required, required this.editable, required this.onTap, @@ -94,7 +92,11 @@ class _MySearchFieldState extends State { return TextField( style: TextStyle( color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), - onChanged: widget.onChanged, + onChanged: (_) { + setState(() { + startup = false; + }); + }, controller: widget.controller, //style: TextStyle(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()), readOnly: makeEditable(), diff --git a/Frontend/patient_manager/lib/components/prescipInput.dart b/Frontend/patient_manager/lib/components/prescipInput.dart index 65452026..19a007db 100644 --- a/Frontend/patient_manager/lib/components/prescipInput.dart +++ b/Frontend/patient_manager/lib/components/prescipInput.dart @@ -129,7 +129,6 @@ class _PrescripInputState extends State { child: MySearchField( controller: widget.medicineController, hintText: "Medicine", - onChanged: (value) {}, required: true, editable: true, onTap: () { diff --git a/Frontend/patient_manager/lib/pages/patientManager.dart b/Frontend/patient_manager/lib/pages/patientManager.dart index c07c1f10..3861cd71 100644 --- a/Frontend/patient_manager/lib/pages/patientManager.dart +++ b/Frontend/patient_manager/lib/pages/patientManager.dart @@ -179,12 +179,11 @@ class _PatientManagerState extends State { MySearchField( controller: searchController, hintText: "ID or Medical Aid No. Search", - required: false, + required: true, editable: true, onTap: () { submitPatientForm(); }, - onChanged: (value) {}, ), //spacer const SizedBox(height: 10), @@ -307,7 +306,7 @@ class _PatientManagerState extends State { MyDateField( controller: queueDateController, LableText: "Date", - required: false, + required: true, ), //spacer const SizedBox(height: 10),