From ace58533d95c329f1b08364448f8cf4614f07e58 Mon Sep 17 00:00:00 2001 From: yaso Date: Tue, 19 Nov 2024 11:16:46 +0200 Subject: [PATCH] add refresh icon to my patient list to check for updates --- .../patient_profile/patient_manager.dart | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Frontend/lib/mih_packages/patient_profile/patient_manager.dart b/Frontend/lib/mih_packages/patient_profile/patient_manager.dart index d00117dc..71f3c573 100644 --- a/Frontend/lib/mih_packages/patient_profile/patient_manager.dart +++ b/Frontend/lib/mih_packages/patient_profile/patient_manager.dart @@ -165,6 +165,13 @@ class _PatientManagerState extends State { checkforchange(); } + void refreshAccessList() { + setState(() { + patientAccessResults = MIHApiCalls.getPatientAccessListOfBusiness( + widget.arguments.business!.business_id); + }); + } + void checkforchange() { if (start == true) { setState(() { @@ -388,9 +395,23 @@ class _PatientManagerState extends State { } }, child: Column(mainAxisSize: MainAxisSize.max, children: [ - const Text( - "My Patient List", - style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + "My Patient List", + style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold), + ), + IconButton( + iconSize: 20, + icon: const Icon( + Icons.refresh, + ), + onPressed: () { + refreshAccessList(); + }, + ), + ], ), Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),