isIPv4 property

bool get isIPv4

Returns true if this is a valid IPv4 address.

Implementation

bool get isIPv4 => RegExp(
      r'^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$',
    ).hasMatch(this);