feat: 更新 WebView 数据目录后缀至 v4;添加清除 WebView HTTP 缓存的方法
This commit is contained in:
@@ -217,9 +217,18 @@ class _H5ShellPageState extends State<H5ShellPage> {
|
||||
});
|
||||
}
|
||||
|
||||
await _clearWebViewHttpCache();
|
||||
await _controller.loadRequest(Uri.parse(url));
|
||||
}
|
||||
|
||||
Future<void> _clearWebViewHttpCache() async {
|
||||
try {
|
||||
await _controller.clearCache();
|
||||
} catch (_) {
|
||||
// Some WebView implementations can reject cache operations before first use.
|
||||
}
|
||||
}
|
||||
|
||||
Future<NavigationDecision> _handleNavigationRequest(
|
||||
NavigationRequest request,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user