Skip to content
pubscout

adblocker_webview

2.3.0, released 11 months ago by didarul.codes

Flutter WebView implementation that blocks ads and trackers using filter lists.

$ flutter pub add adblocker_webview
Source repository

What it does

Provides a WebView widget for Flutter with built-in ad and tracker blocking capabilities based on EasyList and AdGuard filter lists. Supports both URL and HTML content loading, navigation control, custom JavaScript injection, whitelisting, and statistics tracking.

AI-written summary of version 2.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display web content inside your Flutter application while blocking ads and trackers.
  • You require domain-based filtering, custom user agents, and element hiding in a WebView.
  • You want to track blocking statistics and manage whitelisted domains.

Skip it when

  • You require a general-purpose webview without adblocking overhead.
  • You need advanced desktop browser features not supported by the underlying mobile-focused webview plugins.

Strengths

  • Supports EasyList and AdGuard filter lists for robust ad blocking.
  • Provides singleton controller for dynamic domain whitelisting and statistics.
  • Early resource blocking for better performance.

Weaknesses

  • Relies on official Flutter WebView plugin which may have platform-specific limitations.
  • Requires specific minimum Flutter and Dart versions.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
4

Initialize the singleton controller with a FilterConfig in main() before running the app.

AdBlockerWebview(
  url: Uri.parse('https://example.com'),
  shouldBlockAds: true,
  adBlockerWebviewController: AdBlockerWebviewController.instance,
)

Alternatives

Packages that do the same job and could replace adblocker_webview.

Works with

Packages commonly used together with adblocker_webview: ones it builds on, ones built on it, and its own family.