static bool isExpired(String token) { final expirationDate = getExpiryDate(token); if (expirationDate != null) { return DateTime.now().isAfter(expirationDate); } else { return false; } }