When I click any download button from inside my webview, it does nothing. I couldn't find any solution yet, so I'm asking here. Thank you.
Asked
Active
Viewed 1,443 times
0
-
Duplicate of https://stackoverflow.com/questions/57937664/flutter-how-to-download-files-in-webview. See my answer here: https://stackoverflow.com/questions/57937664/flutter-how-to-download-files-in-webview/62116695#62116695 – Lorenzo Pichilli Jun 04 '20 at 09:28
-
Which plugin you have used ? webview_flutter or flutter_webview_plugin?? – srv_sud Feb 04 '21 at 13:21
1 Answers
0
What you have inside a webView can't be handled from the app, you load a url in your web view so everything goes inside the webView is related to the url that you have loaded. what you can do with web view is fore example just refreshing it by swipe refresh. or handling state by :
inner class WebClientCustom : WebViewClient(){
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
super.onPageStarted(view, url, favicon)
}
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
}
@TargetApi(Build.VERSION_CODES.M)
override fun onReceivedError(view: WebView?, request: WebResourceRequest?, error: WebResourceError?) {
}
@SuppressWarnings("deprecation")
override fun onReceivedError(view: WebView, errorCode: Int, description: String, failingUrl: String) {
}
}

Bita Mirshafiee
- 600
- 8
- 14