add new message if access was declined
This commit is contained in:
@@ -118,6 +118,76 @@ class _MIHDeleteMessageState extends State<MIHWarningMessage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setAccessDeclined() {
|
||||||
|
messageTypes["Access Declined"] = Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(popUpPaddingSize),
|
||||||
|
width: popUpWidth,
|
||||||
|
height: popUpheight,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
borderRadius: BorderRadius.circular(25.0),
|
||||||
|
border: Border.all(
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
width: 5.0),
|
||||||
|
),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.warning_amber_rounded,
|
||||||
|
size: popUpIconSize,
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
),
|
||||||
|
//const SizedBox(height: 15),
|
||||||
|
Text(
|
||||||
|
"Access Declined",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
fontSize: popUpTitleSize,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
|
Text(
|
||||||
|
"Your request to access the patient's profile has been denied. Please contact the patient directly to inquire about the reason for this restriction.",
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
fontSize: popUpBodySize,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 5,
|
||||||
|
right: 5,
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
Icons.close,
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.errorColor(),
|
||||||
|
size: 35,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void setExpiredAccess() {
|
void setExpiredAccess() {
|
||||||
messageTypes["Expired Access"] = Stack(
|
messageTypes["Expired Access"] = Stack(
|
||||||
children: [
|
children: [
|
||||||
@@ -207,6 +277,7 @@ class _MIHDeleteMessageState extends State<MIHWarningMessage> {
|
|||||||
checkScreenSize();
|
checkScreenSize();
|
||||||
setNoAccess();
|
setNoAccess();
|
||||||
setExpiredAccess();
|
setExpiredAccess();
|
||||||
|
setAccessDeclined();
|
||||||
//print(size);
|
//print(size);
|
||||||
// setState(() {
|
// setState(() {
|
||||||
// width = size.width;
|
// width = size.width;
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
|||||||
// "Todays: $todayDate\nRevoke Date: $revokeDate\nHas revoke date passed: ${revokeDate.isBefore(todayDate)}");
|
// "Todays: $todayDate\nRevoke Date: $revokeDate\nHas revoke date passed: ${revokeDate.isBefore(todayDate)}");
|
||||||
if (revokeDate.isBefore(todayDate)) {
|
if (revokeDate.isBefore(todayDate)) {
|
||||||
expiredAccessWarning();
|
expiredAccessWarning();
|
||||||
} else if (widget.patientQueue[index].access != "pending") {
|
} else if (widget.patientQueue[index].access == "approved") {
|
||||||
Patient selectedPatient;
|
Patient selectedPatient;
|
||||||
fetchPatients(widget.patientQueue[index].app_id).then(
|
fetchPatients(widget.patientQueue[index].app_id).then(
|
||||||
(result) {
|
(result) {
|
||||||
@@ -127,6 +127,8 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else if (widget.patientQueue[index].access == "declined") {
|
||||||
|
accessDeclinedWarning();
|
||||||
} else {
|
} else {
|
||||||
noAccessWarning();
|
noAccessWarning();
|
||||||
}
|
}
|
||||||
@@ -147,6 +149,15 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void accessDeclinedWarning() {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return const MIHWarningMessage(warningType: "Access Declined");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void expiredAccessWarning() {
|
void expiredAccessWarning() {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
Reference in New Issue
Block a user