isValidSDNId property
bool
get
isValidSDNId
Implementation
bool get isValidSDNId {
if (isEmpty) return false;
if (length > maxLength) return false;
if (!validSigils.contains(substring(0, 1))) {
return false;
}
// event IDs do not have to have a domain
if (substring(0, 1) == '\$') {
return true;
}
// all other sdn IDs have to have a domain
final parts = _getParts();
// the localpart can be an empty string, e.g. for aliases
if (parts.length != 2 || parts[1].isEmpty) {
return false;
}
return true;
}