title: Flutter Webview two way communication with Javascript
body: <p>I have an html file that I am loading in Flutter webview using flutter_webview_plugin. I am using evalJavascript to call function in my javascript code, meaning flutter(dart)->js. However, I also need some way to communicate back something to flutter(dart) layer, meaning js->flutter(dart).</p>
  
  <p>I have tried using 
   - webkit.messageHandlers.native
   - window.native
  to support both platforms(Android,iOS) checking if those are available in JS. But, those comes as undefined. Using following code to get instance of native handler in JS.</p>
  
  <pre><code>typeof webkit !== 'undefined' ? webkit.messageHandlers.native : 
  window.native;
  </code></pre>
  
  <p>And even if I get that instance and post message using it, not sure how to handle it in flutter(dart) layer. I may need to use platform channels. Not sure, if I am in the right direction.</p>
  
  <p>Is there any way through which I can do that? I have evaluated interactive_webview plugin. It works fine on Android. But, it has swift versioning issue and don't want to proceed further with that.</p>
  
  <p>Any help would be appreciated.</p>