mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 14:53:44 +00:00
feat: new ui (#1455)
This commit is contained in:
742 files changed
+59951
-5934
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import 'browser_download_stub.dart'
|
||||
if (dart.library.html) 'entry/browser_download_browser.dart';
|
||||
import 'browser_download_stub.dart' if (dart.library.html) 'entry/browser_download_browser.dart';
|
||||
|
||||
void download(String url, String name) => doDownload(url, name);
|
||||
@@ -1 +1 @@
|
||||
void doDownload(String url, String name) => throw UnimplementedError();
|
||||
void doDownload(String url, String name) => throw UnsupportedError('Browser downloads are only available on web');
|
||||
@@ -1,9 +1,9 @@
|
||||
// ignore: avoid_web_libraries_in_flutter
|
||||
import 'dart:html' as html;
|
||||
import 'package:web/web.dart' as web;
|
||||
|
||||
void doDownload(String url, String name) {
|
||||
final anchorElement = html.AnchorElement(href: url);
|
||||
anchorElement.download = name;
|
||||
anchorElement.target = '_blank';
|
||||
anchorElement.click();
|
||||
final anchor = web.document.createElement('a') as web.HTMLAnchorElement
|
||||
..href = url
|
||||
..download = name
|
||||
..target = '_blank';
|
||||
anchor.click();
|
||||
}
|
||||
Reference in new issue
Block a user