Skip to content

Instantly share code, notes, and snippets.

@diamantidis
Created October 17, 2021 17:31
Show Gist options
  • Save diamantidis/3669c016d05a340ee6f7e713df975383 to your computer and use it in GitHub Desktop.
Save diamantidis/3669c016d05a340ee6f7e713df975383 to your computer and use it in GitHub Desktop.
Flutter web view javascriptChannels (for Medium post)
Widget buildWebView() {
return WebView(
.
.
.
javascriptChannels: <JavascriptChannel>{
JavascriptChannel(
name: 'messageHandler',
onMessageReceived: (JavascriptMessage message) {
print("message from the web view=\"${message.message}\"");
},
)
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment