feature(web): Added option to download file and copy stream url (#209)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-02-01 15:22:22 +01:00 committed by GitHub
parent 54babaec89
commit bd8faf2f6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 18 deletions

View file

@ -0,0 +1,11 @@
import 'package:universal_html/html.dart' as html;
Future<void> downloadFile(String url) async {
try {
html.AnchorElement anchorElement = html.AnchorElement(href: url);
anchorElement.download = url;
anchorElement.click();
} catch (e) {
print('Download error: $e');
}
}