Answers for "interact with flutter and javascript"

0

interact with flutter and javascript

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 studio
                      print(message.message);
                    })
              ]),
              onWebViewCreated: (WebViewController w) {
                webViewController = w;
              },
            )
Posted by: Guest on July-10-2021
0

interact with flutter and javascript

<script type='text/javascript'>
    Print.postMessage('Hello World being called from Javascript code');
</script>
Posted by: Guest on July-10-2021

Code answers related to "interact with flutter and javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language