show different no access message when pending or declined

This commit is contained in:
2024-11-15 10:00:44 +02:00
parent a2ec41fb13
commit 6e4a172ab9

View File

@@ -236,13 +236,22 @@ class _BuildPatientsListState extends State<BuildPatientAccessList> {
); );
} }
void noAccessWarning() { void noAccessWarning(int index) {
showDialog( if (widget.patientAccesses[index].status == "pending") {
context: context, showDialog(
builder: (context) { context: context,
return const MIHWarningMessage(warningType: "No Access"); builder: (context) {
}, return const MIHWarningMessage(warningType: "No Access");
); },
);
} else {
showDialog(
context: context,
builder: (context) {
return const MIHWarningMessage(warningType: "Access Declined");
},
);
}
} }
bool hasAccessToProfile(int index) { bool hasAccessToProfile(int index) {
@@ -417,7 +426,7 @@ class _BuildPatientsListState extends State<BuildPatientAccessList> {
}); });
patientProfileChoicePopUp(index, p); patientProfileChoicePopUp(index, p);
} else { } else {
noAccessWarning(); noAccessWarning(index);
} }
}, },
trailing: Icon( trailing: Icon(