AdBlockerWebviewController class abstract interface

The controller for AdBlockerWebview. Below is and Example of getting a singleton instance:

   final _adBlockerWebviewController = AdBlockerWebviewController.instance;

It's better to warm up the controller before displaying the webview. It's possible to do that by:

  @override
  void initState() {
    super.initState();
    _adBlockerWebviewController.initialize(config);
    /// ... Other code here.
  }

ignore_for_file: avoid-late-keyword ignore_for_file: avoid-non-null-assertion

Implementers

Properties

allowedDomains → Set<String>
Returns the set of allowed (whitelisted) domains
no setter
allResourceRules → UnmodifiableListView<ResourceRule>
Returns the all resource rules list. This list items are populated after calling the initialize method
no setter
blockedDomains → Set<String>
Returns the set of blocked domains (custom block list)
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
statistics → BlockingStatistics
Returns the blocking statistics
no setter

Methods

addAllowedDomain(String domain) → void
Adds a domain to the whitelist
addBlockedDomain(String domain) → void
Adds a domain to the custom block list
canGoBack() → Future<bool>
Returns decision of if the webview can go back
canGoForward() → Future<bool>
Returns decision of if he webview can go forward
clearCache() → Future<void>
getCssRulesForWebsite(String url) → List<String>
Returns the css rules for the given url
getTitle() → Future<String?>
goBack() → Future<void>
Navigates webview to previous page
goForward() → Future<void>
Navigates the webview to forward page
initialize(FilterConfig filterConfig) → Future<void>
Initializes the controller with the given filter configuration
isAllowedDomain(String urlOrDomain) → bool
Checks if a domain is in the whitelist
isBlockedDomain(String urlOrDomain) → bool
Checks if a domain is in the custom block list
loadData(String data, {String? baseUrl}) → Future<void>
loadUrl(String url) → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload() → Future<void>
Reloads the current page
removeAllowedDomain(String domain) → bool
Removes a domain from the whitelist
removeBlockedDomain(String domain) → bool
Removes a domain from the custom block list
resetStatistics() → void
Resets the blocking statistics
runScript(String script) → Future<void>
Runs the given script
setInternalController(WebViewController controller) → void
Sets WebViewController to be used in future Typically not to be used by third parties
inherited
shouldBlockResource(String url) → bool
Returns decision of if the resource should be blocked
stopLoading() → Future<void>
Stops loading the current page
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

instance → AdBlockerWebviewController
Returns an implementation of this class
no setter