setStatusColor method
Color
setStatusColor(
- dynamic status
)
Implementation
Color setStatusColor(status) {
Color statusColor = Colors.cyan;
if (status.toLowerCase() == "approved" ||
status.toLowerCase() == "completed" ||
status.toLowerCase() == "resolved" ||
status.toLowerCase() == "success" ||
status.toLowerCase() == "present" ||
status.toLowerCase() == "done" ||
status.toLowerCase() == "pass" ||
status.toLowerCase() == "paid" ||
status.toLowerCase() == "issued") {
statusColor = Colors.green;
} else if (status.toLowerCase() == "pending" ||
status.toLowerCase() == "not paid" ||
status.toLowerCase() == "absent" ||
status.toLowerCase() == "requested") {
statusColor = Colors.amber.shade600;
} else if (status.toLowerCase() == "rejected" ||
status.toLowerCase() == "failure" ||
status.toLowerCase() == "not completed" ||
status.toLowerCase() == "fail" ||
status.toLowerCase() == "not attempted" ||
status.toLowerCase() == "cancelled") {
statusColor = Colors.red;
} else {
statusColor = Colors.cyan;
}
return statusColor;
}