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, you need to set InAppWebViewSettings.useOnDownloadStart
setting to true
.
Officially Supported Platforms/Implementations:
- Android native WebView (Official API - WebView.setDownloadListener)
- iOS
- MacOS
- Windows (Official API - ICoreWebView2_4.add_DownloadStarting)
Implementation
@override
FutureOr<DownloadStartResponse?>? onDownloadStarting(
DownloadStartRequest downloadStartRequest) {
return null;
}