update queue date field to be reuired.

update searchfield to not submit when nothing is entered.
This commit is contained in:
2024-08-12 17:16:31 +02:00
parent 1a0f696db1
commit 444ad269ae
4 changed files with 11 additions and 10 deletions

View File

@@ -69,9 +69,10 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
),
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(

View File

@@ -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<MySearchField> {
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(),

View File

@@ -129,7 +129,6 @@ class _PrescripInputState extends State<PrescripInput> {
child: MySearchField(
controller: widget.medicineController,
hintText: "Medicine",
onChanged: (value) {},
required: true,
editable: true,
onTap: () {

View File

@@ -179,12 +179,11 @@ class _PatientManagerState extends State<PatientManager> {
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<PatientManager> {
MyDateField(
controller: queueDateController,
LableText: "Date",
required: false,
required: true,
),
//spacer
const SizedBox(height: 10),