I am making flutter web app that should generate a file from user data. And have the option to download the output file.
But I can not find any options/packages which works for flutter web :(
Can someone please help me out?
It can recognize downloadable files in both Android (using setDownloadListener ) and iOS platforms! To be able to recognize downloadable files, you need to set the useOnDownloadStart: true option, and then you can listen the onDownloadStart event! Then, you need to ask permission using the permission_handler plugin.
Just call the method saveFile() with respective arguments.
Simple Code for redirecting to download URL
import 'dart:html' as html; void downloadFile(String url) { html.AnchorElement anchorElement = new html.AnchorElement(href: url); anchorElement.download = url; anchorElement.click(); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With