tryParse static method

IPv4Network? tryParse(
  1. String addr, {
  2. bool strict = true,
})

Creates a new IPv4Network. Like constructor except that this function returns null.

Implementation

static IPv4Network? tryParse(String addr, {bool strict = true}) {
  if (addr.isEmpty) return null;
  try {
    return IPv4Network(addr, strict: strict);
  } catch (e) {
    return null;
  }
}