A federated contract separating Dart models from native CEF engines.
Federated Flutter plugins succeed when the public platform contract stays stable, testable, and completely decoupled from heavy native build toolchains.
flutter_chromium_webview_platform_interface defines the canonical abstract interface, shared immutable value types, and default MethodChannel transport used by flutter_chromium_webview across all host operating systems.
Application developers depend on flutter_chromium_webview directly, while platform backend authors extend ChromiumWebViewPlatform with token verification—enabling pure-Dart mocking, deterministic contract tests, and non-breaking minor API evolution.
Drop-in installation and Dart API.
Published as flutter_chromium_webview_platform_interface on pub.dev (v0.1.7, published Oct 16, 2026) with 160 / 160 pub points.
dependencies:
flutter_chromium_webview_platform_interface: ^0.1.7class MyCustomBackend extends ChromiumWebViewPlatform {
@override
Future<BrowserCreationResult> createBrowser(
BrowserCreationParams params,
) async {
// Custom platform implementation
}
}
ChromiumWebViewPlatform.instance = MyCustomBackend();Clean separation across plugin layers.
Zero CEF, GTK, Win32, or Cocoa headers—just strongly typed Dart contracts, stream events, and method-channel serialization.
Token-Enforced PlatformInterface
ChromiumWebViewPlatform registers a private verification token through plugin_platform_interface. Assigning an incompatible instance immediately fails with an AssertionError, protecting downstream plugins across minor upgrades.
Async JS Evaluation & Cancellation
Publishes evaluateJavaScript with explicit operationId and timeoutMs parameters alongside cancelJavaScript, letting host controllers abort slow evaluations cleanly while preserving executeJavaScript.
Typed Input, Keychain & Profile Models
Exports immutable BrowserCreationParams (with profileName and origin-keyed javaScriptChannels), BrowserCreationResult (browserId, textureId, popupTextureId), PointerInput with clickCount, and ChromiumKeychainBehavior.
Crash-Aware Browser Event Stream
Exposes a broadcast Stream<BrowserEvent> forwarding navigation updates, dialog requests, context menus, and native renderer/GPU crash notifications through MethodChannelChromiumWebView.
Exported Libraries, Types & Transport
- ChromiumWebViewPlatform abstract base
- MethodChannelChromiumWebView transport
- BrowserCreationParams & BrowserCreationResult
- PointerInput & PointerInputType enum
- BrowserEvent & ChromiumWebViewException
- initialize(cachePath, sessionId, keychainBehavior)
- createBrowser & idempotent disposeBrowser
- loadUrl, loadHtml, reload, goBack, goForward
- resize, setFocus, sendPointerInput
- closeJavaScriptDialog & closeContextMenu
- Android, iOS, Windows, Linux, macOS, Web
- Sound null-safe & Dart 3 compatible
- Wasm-ready pure Dart interface
- Includes runnable in-memory backend example
- Required ^0.1.7 by flutter_chromium_webview 0.5.5