equals static method
Safely compares two strings. If both are null returns true If one of them is null returns false if both are the same returns true.
Implementation
static bool equals(String? lhs, String? rhs) {
if (lhs == null && rhs == null) return true;
if (lhs == null) return false;
if (rhs == null) return false;
if (!(lhs == rhs)) return false;
return true;
}