Validates if the given string is a valid IPv4 address.
static bool isValidIPv4(String ip) { final regex = RegExp(r'^((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.|\b)){4}\$'); return regex.hasMatch(ip); }