forked from yaso_meth/mih-project
add check on expirey date
This commit is contained in:
@@ -89,7 +89,13 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
if (widget.patientQueue[index].access != "pending") {
|
||||
var todayDate = DateTime.now();
|
||||
var revokeDate = DateTime.parse(widget.patientQueue[index].revoke_date);
|
||||
print(
|
||||
"Todays: $todayDate\nRevoke Date: $revokeDate\nHas revoke date passed: ${revokeDate.isBefore(todayDate)}");
|
||||
if (revokeDate.isBefore(todayDate)) {
|
||||
expiredAccessWarning();
|
||||
} else if (widget.patientQueue[index].access != "pending") {
|
||||
Patient selectedPatient;
|
||||
fetchPatients(widget.patientQueue[index].app_id).then(
|
||||
(result) {
|
||||
@@ -121,6 +127,15 @@ class _BuildPatientsListState extends State<BuildPatientQueueList> {
|
||||
);
|
||||
}
|
||||
|
||||
void expiredAccessWarning() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return const MIHWarningMessage(warningType: "Expired Access");
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
|
||||
Reference in New Issue
Block a user