You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
Here is an example of communication from Javascript code to flutter.
In Flutter build your WebView like :
WebView(
initialUrl: url,
javascriptMode:JavascriptMode.unrestricted,
javascriptChannels:Set.from([
JavascriptChannel(
name:'Print',
onMessageReceived: (JavascriptMessage message) {
//This is where you receive message from //javascript code and handle in Flutter/Dart//like here, the message is just being printed//in Run/LogCat window of android studioprint(message.message);
})
]),
onWebViewCreated: (WebViewController w) {
webViewController = w;
},
)
and in Your HTMLfile:
<scripttype='text/javascript'>Print.postMessage('Hello World being called from Javascript code');</script>
The text was updated successfully, but these errors were encountered:
Here is an example of communication from Javascript code to flutter.
In Flutter build your WebView like :
and in Your HTMLfile:
The text was updated successfully, but these errors were encountered: