Created
October 17, 2021 17:31
-
-
Save diamantidis/3669c016d05a340ee6f7e713df975383 to your computer and use it in GitHub Desktop.
Flutter web view javascriptChannels (for Medium post)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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