onDownloadStarting method
FutureOr<DownloadStartResponse?> ?
onDownloadStarting(
- DownloadStartRequest downloadStartRequest
inherited
Event fired when WebView recognizes a downloadable file.
To download the file, you can use the flutter_downloader plugin.
downloadStartRequest represents the request of the file to download.
NOTE: In order to be able to listen this event, check the InAppWebViewSettings.useOnDownloadStart setting documentation.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.setDownloadListener
- iOS WKWebView
- macOS WKWebView
- Windows WebView2 (Official API - ICoreWebView2_4.add_DownloadStarting)
Parameters - Officially Supported Platforms/Implementations:
downloadStartRequest: all platforms
Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.
Implementation
@override
FutureOr<DownloadStartResponse?>? onDownloadStarting(
DownloadStartRequest downloadStartRequest,
) {
return null;
}