ContentBlockerTrigger class Null safety

Trigger of the content blocker. The trigger tells to the WebView when to perform the corresponding action. A trigger dictionary must include an ContentBlockerTrigger.urlFilter, which specifies a pattern to match the URL against. The remaining properties are optional and modify the behavior of the trigger. For example, you can limit the trigger to specific domains or have it not apply when a match is found on a specific domain.

Constructors

ContentBlockerTrigger({required String urlFilter, bool urlFilterIsCaseSensitive = false, List<ContentBlockerTriggerResourceType> resourceType = const [], List<String> ifDomain = const [], List<String> unlessDomain = const [], List<ContentBlockerTriggerLoadType> loadType = const [], List<String> ifTopUrl = const [], List<String> unlessTopUrl = const []})

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
ifDomain List<String>
A list of strings matched to a URL's domain; limits action to a list of specific domains. Values must be lowercase ASCII, or punycode for non-ASCII. Add * in front to match domain and subdomains. Can't be used with ContentBlockerTrigger.unlessDomain.
read / write
ifTopUrl List<String>
A list of strings matched to the entire main document URL; limits the action to a specific list of URL patterns. Values must be lowercase ASCII, or punycode for non-ASCII. Can't be used with ContentBlockerTrigger.unlessTopUrl.
read / write
loadType List<ContentBlockerTriggerLoadType>
A list of ContentBlockerTriggerLoadType that can include one of two mutually exclusive values. If not specified, the rule matches all load types.
read / write
resourceType List<ContentBlockerTriggerResourceType>
A list of ContentBlockerTriggerResourceType representing the resource types (how the browser intends to use the resource) that the rule should match. If not specified, the rule matches all resource types.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
unlessDomain List<String>
A list of strings matched to a URL's domain; acts on any site except domains in a provided list. Values must be lowercase ASCII, or punycode for non-ASCII. Add * in front to match domain and subdomains. Can't be used with ContentBlockerTrigger.ifDomain.
read / write
unlessTopUrl List<String>
An array of strings matched to the entire main document URL; acts on any site except URL patterns in provided list. Values must be lowercase ASCII, or punycode for non-ASCII. Can't be used with ContentBlockerTrigger.ifTopUrl.
read / write
urlFilter String
A regular expression pattern to match the URL against.
read / write
urlFilterIsCaseSensitive bool
Used only by iOS. A Boolean value. The default value is false.
read / write

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toMap() Map<String, dynamic>
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

fromMap(Map<String, dynamic> map) ContentBlockerTrigger