我在 Flutter 项目中使用了 WebView_plugin。我可以加载我自己的网站。但是我的网站更新不存在。估计是缓存问题。
我试图传递一些选项,例如: clearCache,appCacheEnabled但我的网站更新不在那里。
我如何实例化我的网络视图:
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)
如何清除缓存?
我想使用cropper.js(https://github.com/fengyuanchen/cropperjs)创建一个带有angular-cli的Angular2裁剪器.
我的指示是:
import {Directive, ElementRef, Input, OnInit} from '@angular/core';
import Cropper from 'cropperjs';
@Directive({
selector: '[ng2-cropper]'
})
export class Ng2CropperJsDirective implements OnInit {
@Input('options') options: any = {};
private cropper;
constructor(private _element: ElementRef) { }
ngOnInit(): void {
console.log(Cropper);
this.cropper = new Cropper(this._element.nativeElement, this.options);
}
}
Run Code Online (Sandbox Code Playgroud)
错误来自ng serve: Cannot find module 'cropperjs'
但是cropperjs在,node_modules并且我angular-cli.json更新了:
"scripts": [
"../node_modules/cropperjs/dist/cropper.js"
],
Run Code Online (Sandbox Code Playgroud)
我没有任何想法来解决问题..
GetIt 是Dart 和 Flutter 项目的服务定位器( https://github.com/fluttercommunity/get_it )
我认为 GetIt 应该为我们提供一些有关循环依赖的详细信息。
例如,当我运行测试时,存在无限循环并且永远不会结束。