feat: 更新 WebView 数据目录后缀至 v4;添加清除 WebView HTTP 缓存的方法

This commit is contained in:
Booker
2026-05-26 20:53:46 +07:00
parent 2857047df2
commit b2a79e7f21
2 changed files with 11 additions and 2 deletions

View File

@@ -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 {