add new but when access declined

This commit is contained in:
2024-11-18 09:44:07 +02:00
parent c25e2d9629
commit 2f70f358fe

View File

@@ -355,7 +355,7 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
lnameController.text = firstLetterLName + lnameStar; lnameController.text = firstLetterLName + lnameStar;
accessStatusController.text = accessStatus.toUpperCase(); accessStatusController.text = accessStatus.toUpperCase();
}); });
//print(accessStatus);
showDialog( showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
@@ -511,7 +511,7 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
), ),
), ),
Visibility( Visibility(
visible: !hasAccess && accessStatus != "pending", visible: !hasAccess && accessStatus == "No Access",
child: SizedBox( child: SizedBox(
width: 300, width: 300,
height: 50, height: 50,
@@ -522,7 +522,7 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
textColor: textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(), MzanziInnovationHub.of(context)!.theme.primaryColor(),
onTap: () { onTap: () {
print("Send access Request..."); //print("Send access Request...");
MIHApiCalls.addPatientAccessAPICall( MIHApiCalls.addPatientAccessAPICall(
widget.business!.business_id, widget.business!.business_id,
widget.patients[index].app_id, widget.patients[index].app_id,
@@ -535,6 +535,29 @@ class _BuildPatientsListState extends State<BuildPatientsList> {
), ),
), ),
), ),
Visibility(
visible: !hasAccess && accessStatus == "declined",
child: SizedBox(
width: 300,
height: 50,
child: MIHButton(
buttonText: "Re-apply",
buttonColor:
MzanziInnovationHub.of(context)!.theme.successColor(),
textColor:
MzanziInnovationHub.of(context)!.theme.primaryColor(),
onTap: () {
print("Send rewaply access Request...");
MIHApiCalls.reapplyPatientAccessAPICall(
widget.business!.business_id,
widget.patients[index].app_id,
widget.arguments,
context,
);
},
),
),
),
Visibility( Visibility(
visible: !hasAccess && accessStatus == "pending", visible: !hasAccess && accessStatus == "pending",
child: const SizedBox( child: const SizedBox(