androidShouldInterceptRequest property Null safety
Notify the host application of a resource request and allow the application to return the data.
If the return value is
null, the WebView will continue to load the resource as usual.
Otherwise, the return response and data will be used.
This callback is invoked for a variety of URL schemes (e.g.,
not only those schemes which send requests over the network.
This is not called for
blob: URLs, or for assets accessed via
In the case of redirects, this is only called for the initial resource URL, not any subsequent redirect URLs.
request Object containing the details of the request.
NOTE: available only on Android. In order to be able to listen this event, you need to set AndroidInAppWebViewOptions.useShouldInterceptRequest option to
Official Android API:
final Future<WebResourceResponse?> Function( InAppWebViewController controller, WebResourceRequest request)? androidShouldInterceptRequest;