javascriptChannels property
The set of JavascriptChannels available to JavaScript code running in the web view.
For each JavascriptChannel in the set, a channel object is made available for the
JavaScript code in a window property named JavascriptChannel.name.
The JavaScript code can then call postMessage
on that object to send a message that will be
passed to JavascriptChannel.onMessageReceived.
For example for the following JavascriptChannel:
JavascriptChannel(name: 'Print', onMessageReceived: (JavascriptMessage message) { print(message.message); });
JavaScript code can call:
Print.postMessage('Hello');
To asynchronously invoke the message handler which will print the message to standard output.
Adding a new JavaScript channel only takes affect after the next page is loaded.
Set values must not be null. A JavascriptChannel.name cannot be the same for multiple channels in the list.
A null value is equivalent to an empty set.
Implementation
final Set<JavascriptChannel>? javascriptChannels;