setSafeBrowsingAllowlist static method

Future<bool> setSafeBrowsingAllowlist({
  1. required List<String> hosts,
})

Sets the list of hosts (domain names/IP addresses) that are exempt from SafeBrowsing checks. The list is global for all the WebViews.

Each rule should take one of these:

Rule Example Matches Subdomain
HOSTNAME example.com Yes
.HOSTNAME .example.com No
IPV4_LITERAL 192.168.1.1 No
IPV6_LITERAL_WITH_BRACKETS 10:20:30:40:50:60:70:80 No

All other rules, including wildcards, are invalid. The correct syntax for hosts is defined by RFC 3986.

hosts represents the list of hosts. This value must never be null.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • hosts: all platforms

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

static Future<bool> setSafeBrowsingAllowlist({required List<String> hosts}) =>
    PlatformInAppWebViewController.static().setSafeBrowsingAllowlist(
      hosts: hosts,
    );