FlareLaneJavascriptInterface class

flutter_inappwebview-specific adapter exposing the FlareLane bridge in shape that matches flutter_inappwebview's InAppWebView widget slots (initialUserScripts, addJavaScriptHandler via onWebViewCreated).

Compatible with flutter_inappwebview: '>=5.0.0 <7.0.0'. The 6.x major migration only broke URL-typed APIs (UriWebUri), which this adapter does not touch — UserScript, UserScriptInjectionTime.AT_DOCUMENT_START, InAppWebViewController, and evaluateJavascript(source:) are stable across both 5.x and 6.x.

Example — alongside the customer's existing user scripts / handlers:

InAppWebView(
  initialUrlRequest: URLRequest(url: WebUri(url)),
  initialUserScripts: UnmodifiableListView([
    ...FlareLaneJavascriptInterface.initialUserScripts,
    ...myUserScripts,
  ]),
  onWebViewCreated: (controller) {
    controller.addJavaScriptHandler(
      handlerName: FlareLaneJavascriptInterface.BRIDGE_NAME,
      callback: FlareLaneJavascriptInterface.handlerCallback(controller),
    );
    myOnWebViewCreated(controller);
  },
);

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

initialUserScripts UnmodifiableListView<UserScript>
UserScript list ready to plug into InAppWebView(initialUserScripts: …). Installs the bridge shim at document start so the Web SDK detects window.FlareLaneBridge before any page scripts run.
no setter

Static Methods

handlerCallback(InAppWebViewController controller) Future<void> Function(List)
Returns a callback ready to plug into controller.addJavaScriptHandler(handlerName: BRIDGE_NAME, callback: …). Each incoming message is routed through the FlareLane bridge core; if the core returns a JS string (e.g. the syncDeviceData response), it is evaluated back into the webview via the controller.

Constants

BRIDGE_NAME → const String
Channel name constant — mirrors the native SDK's BRIDGE_NAME.