Returns true if host is localhost (also checks for IPv4 and IPv6 addresses).
true
host
bool isLocalhost(String? host) { if (host == null || host.isEmpty) return false; return _regexpLocalhost.hasMatch(host); }