removeFromCache static method
Static method to remove a URL from the proxy cache Use this to remove a URL that was previously marked as requiring a proxy The next load attempt will try a direct connection without the proxy
Example usage:
Stack(children: [
SWebView(url: 'https://example.com'),
Positioned(
top: 10,
right: 10,
child: PointerInterceptor(
child: ElevatedButton(
onPressed: () => SWebView.removeFromCache('https://example.com'),
child: Text('Clear Proxy Cache'),
),
),
),
])
Implementation
static Future<void> removeFromCache(String url) async {
if (kDebugMode) {
debugPrint('SWebView: Removing $url from proxy cache');
}
_SWebViewState._restrictionCache.remove(url);
await _SWebViewState._saveCache();
}