Acces review color coding access types
This commit is contained in:
@@ -94,38 +94,70 @@ class _BuildPatientsListState extends State<BuildAccessRequestList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget displayQueue(int index) {
|
Widget displayQueue(int index) {
|
||||||
String title =
|
String line1 =
|
||||||
"Appointment: ${widget.accessRequests[index].date_time.substring(0, 16).replaceAll("T", " ")}";
|
"Appointment: ${widget.accessRequests[index].date_time.substring(0, 16).replaceAll("T", " ")}";
|
||||||
String subtitle = "";
|
String line2 = "";
|
||||||
subtitle += "Requestor: ${widget.accessRequests[index].Name}\n";
|
line2 += "Requestor: ${widget.accessRequests[index].Name}\n";
|
||||||
//subtitle += "Business Type: ${widget.accessRequests[index].type}\n";
|
//subtitle += "Business Type: ${widget.accessRequests[index].type}\n";
|
||||||
|
String line3 = "Access: ";
|
||||||
|
String access = "";
|
||||||
var nowDate = DateTime.now();
|
var nowDate = DateTime.now();
|
||||||
var expireyDate = DateTime.parse(widget.accessRequests[index].revoke_date);
|
var expireyDate = DateTime.parse(widget.accessRequests[index].revoke_date);
|
||||||
|
|
||||||
if (expireyDate.isBefore(nowDate)) {
|
if (expireyDate.isBefore(nowDate)) {
|
||||||
subtitle += "Access: EXPIRED\n";
|
access += "EXPIRED\n";
|
||||||
} else {
|
} else {
|
||||||
subtitle +=
|
access += "${widget.accessRequests[index].access.toUpperCase()}";
|
||||||
"Access: ${widget.accessRequests[index].access.toUpperCase()}\n";
|
|
||||||
}
|
}
|
||||||
|
String line4 = "";
|
||||||
if (widget.accessRequests[index].revoke_date.contains("9999")) {
|
if (widget.accessRequests[index].revoke_date.contains("9999")) {
|
||||||
subtitle += "Access Expiration date: NOT SET";
|
line4 += "Access Expiration date: NOT SET";
|
||||||
} else {
|
} else {
|
||||||
subtitle +=
|
line4 +=
|
||||||
"Access Expiration date: ${widget.accessRequests[index].revoke_date.substring(0, 10)}";
|
"Access Expiration date: ${widget.accessRequests[index].revoke_date.substring(0, 10)}";
|
||||||
}
|
}
|
||||||
|
TextSpan accessWithColour;
|
||||||
|
if (access == "APPROVED") {
|
||||||
|
accessWithColour = TextSpan(
|
||||||
|
text: "$access\n",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.successColor()));
|
||||||
|
} else if (access == "PENDING") {
|
||||||
|
accessWithColour = TextSpan(
|
||||||
|
text: "$access\n",
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
MzanziInnovationHub.of(context)!.theme.messageTextColor()));
|
||||||
|
} else {
|
||||||
|
accessWithColour = TextSpan(
|
||||||
|
text: "$access\n",
|
||||||
|
style: TextStyle(
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.errorColor()));
|
||||||
|
}
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
title,
|
line1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: RichText(
|
||||||
subtitle,
|
text: TextSpan(
|
||||||
style: TextStyle(
|
text: line2,
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
style: DefaultTextStyle.of(context).style,
|
||||||
),
|
children: <TextSpan>[
|
||||||
|
TextSpan(text: line3),
|
||||||
|
accessWithColour,
|
||||||
|
TextSpan(text: line4),
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
|
// Text(
|
||||||
|
// subtitle,
|
||||||
|
// style: TextStyle(
|
||||||
|
// color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
viewApprovalPopUp(index);
|
viewApprovalPopUp(index);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user