tryParse static method
Attempts to parse address
as a numeric address.
Returns null
If address
is not a numeric IPv4 (dotted-decimal
notation) or IPv6 (hexadecimal representation) address.
Implementation
static InternetAddress? tryParse(String address) {
final rawAddress = _tryParseRawAddress(address);
if (rawAddress == null) {
return null;
}
final type = _type(address);
return InternetAddress._(
address: address,
rawAddress: rawAddress,
type: type,
);
}