2

I am trying to build a flutter app and I am trying to show up website in a webview I am using "flutter_webview_plugin: ^0.3.11" now I am trying to evaluate some javascript in order to delete some items before displaying the web page here is the code of the webview:

    @override
Widget build(BuildContext context) {
return WebviewScaffold(
  url: 'https://www.amazon.com',
  appBar: AppBar(
    title: Text('Amazon store'),
  ),
  initialChild: WebviewAnimation(),
  withJavascript: true,
);

and here is the code of evaluating I am listening to onStateChanged like below:

void initState() {
super.initState();
_onUrlChanged = flutterWebViewPlugin.onUrlChanged.listen((event) {
  this.url = event;
});
_onStateChanged =
    flutterWebViewPlugin.onStateChanged.listen((WebViewStateChanged state) {
  if (mounted) {
    setState(() {
      flutterWebViewPlugin.hide();
      var kiki = flutterWebViewPlugin.evalJavascript(
          "document.getElementsByClassName(\"a-button-stack\")[0].style.display='none';");
      _history.add('onStateChanged: ${state.type} ${state.url}');
      kiki.then((value) {
        setState(() {
          flutterWebViewPlugin.show();
        });
      });
    });
  }
});

by doing this I am able to evaluate js, the problem is it takes too long to evaluate, therefore I want to show up the page once it has been evaluated...any ideas ...thanks in advance

kikicoder
  • 383
  • 3
  • 16
  • Similar issue is explained in this post https://stackoverflow.com/questions/49770465/cudnn-status-not-initialized-when-trying-to-run-tensorflow the problem was in the incompatible version of cudNN, check this out, maybe the problem is here – jwpol Jul 18 '20 at 00:09
  • Does this answer your question? [CUDNN\_STATUS\_NOT\_INITIALIZED when trying to run TensorFlow](https://stackoverflow.com/questions/49770465/cudnn-status-not-initialized-when-trying-to-run-tensorflow) – AMC Jul 18 '20 at 00:11
  • Have you considered just using colab (which has access to some free GPUs) to run the model? It should be quite easy. (See https://www.tensorflow.org/tutorials/images/transfer_learning_with_hub if you dont know about tf hub yet.) – Henry Tsai Jul 19 '20 at 02:28
  • Check whether tensorflow-gpu==1.5 is installed properly or not. And also you may try gpu memory resource management by allowing gpu memory growth like `config = tf.ConfigProto() config.gpu_options.allow_growth = True` –  Jan 04 '21 at 09:54

0 Answers0