isLocalhost function

bool isLocalhost(
  1. String? host
)

Returns true if host is localhost (also checks for IPv4 and IPv6 addresses).

Implementation

bool isLocalhost(String? host) {
  if (host == null || host.isEmpty) return false;
  return _regexpLocalhost.hasMatch(host);
}