from_str static method

Result<IPAddress, String> from_str(
  1. String str,
  2. int radix,
  3. int prefix
)

Implementation

static Result<IPAddress, String> from_str(String str, int radix, int prefix) {
  try {
    final num = BigInt.parse(str, radix: radix);
    return from_int(num, prefix);
  } catch (e) {
    return Result.error("unparsable ${str}");
  }
}