flutter_webview_plugin 包的 clearCache 不起作用

Pie*_*LOT 10 dart flutter flutter-dependencies

我在 Flutter 项目中使用了 WebView_plugin。我可以加载我自己的网站。但是我的网站更新不存在。估计是缓存问题。

我试图传递一些选项,例如: clearCacheappCacheEnabled但我的网站更新不在那里。

我如何实例化我的网络视图:

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,
    );
Run Code Online (Sandbox Code Playgroud)

在我的pubspec.yaml

dependencies:
  flutter_webview_plugin: ^0.3.5
Run Code Online (Sandbox Code Playgroud)

如何清除缓存?

小智 1

首先尝试一下,clearCache: true然后再尝试一下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,
        );
Run Code Online (Sandbox Code Playgroud)