Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clearCache of flutter_webview_plugin package doesn't work

I use the WebView_plugin in my Flutter project. I can load my own website. But my website updates aren't there. I guess it's a cache issue.

I tried to pass some options like: clearCache, appCacheEnabled but my website updates aren't there.

How I instantiate my webview:

dart 
    final webView = WebviewScaffold(
      url: url,
      clearCache: true, // <-- I don't want cache 
      appCacheEnabled: false, // <-- I don't want cache
      initialChild: Container(
        color: Colors.white,
        child: const Center(
          child: const CircularProgressIndicator(),
        ),
      ),
      withZoom: false,
      withLocalStorage: true,
      hidden: true,
    );

In my pubspec.yaml:

dependencies:
  flutter_webview_plugin: ^0.3.5

How do I clear the cache?

like image 203
Pierre-Luc BLOT Avatar asked May 18 '19 23:05

Pierre-Luc BLOT


1 Answers

try it, frist clearCache: true and after appcacheEnable: false

    dart 
        final webView = WebviewScaffold(      
          clearCache: true, // <-- first clearCache
          appCacheEnabled: false, // <--after it :3
          url: url,
          initialChild: Container(
            color: Colors.white,
            child: const Center(
              child: const CircularProgressIndicator(),
            ),
          ),
          withZoom: false,
          withLocalStorage: true,
          hidden: true,
        );
like image 187
Cristian Camilo tafur morales Avatar answered Oct 24 '22 07:10

Cristian Camilo tafur morales