0

I have build an app using webview_flutter plugin, now I want to hide a div from my webview. The issue is I'm not able to figure out how to run custom Javascript using this webview_flutter. I have read articles on stackoverflow for flutter_webview_plugin but not for this one.

Apoorv pandey
  • 509
  • 8
  • 21

1 Answers1

0

Running custom JS

It is really simple to do so using the webview_flutter plugin. You can simply use the controller object as,

_your_webview_controller.evaluateJavascript("<Some JS code>");

Hiding the div

_controller.evaluateJavascript(
              "document.getElementsByClassName('openAppButton')[0].style.display = 'none'");

Apoorv pandey
  • 509
  • 8
  • 21