ContentBlocker class Null safety

Class that represents a set of rules to use block content in the browser window.

On iOS, it uses WKContentRuleListStore. On Android, it uses a custom implementation because such functionality doesn't exist.

In general, this article can be used to get an overview about this functionality but on Android there are two types of action that are unavailable: block-cookies and ignore-previous-rules.


ContentBlocker({required ContentBlockerTrigger trigger, required ContentBlockerAction action})


action ContentBlockerAction
Action associated to the trigger. The action tells to the WebView what to do when the trigger is matched.
read / write
hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
trigger ContentBlockerTrigger
Trigger of the content blocker. The trigger tells to the WebView when to perform the corresponding action.
read / write


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


operator ==(Object other) bool
The equality operator.

Static Methods

fromMap(Map<dynamic, Map> map) ContentBlocker