add refresh icon to my patient list to check for updates

This commit is contained in:
2024-11-19 11:16:46 +02:00
parent 1c88543cf7
commit ace58533d9

View File

@@ -165,6 +165,13 @@ class _PatientManagerState extends State<PatientManager> {
checkforchange(); checkforchange();
} }
void refreshAccessList() {
setState(() {
patientAccessResults = MIHApiCalls.getPatientAccessListOfBusiness(
widget.arguments.business!.business_id);
});
}
void checkforchange() { void checkforchange() {
if (start == true) { if (start == true) {
setState(() { setState(() {
@@ -388,9 +395,23 @@ class _PatientManagerState extends State<PatientManager> {
} }
}, },
child: Column(mainAxisSize: MainAxisSize.max, children: [ child: Column(mainAxisSize: MainAxisSize.max, children: [
const Text( Row(
"My Patient List", mainAxisAlignment: MainAxisAlignment.center,
style: TextStyle(fontSize: 25, fontWeight: FontWeight.bold), 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()), Divider(color: MzanziInnovationHub.of(context)!.theme.secondaryColor()),