owlnext_dropzone 1.0.0
owlnext_dropzone: ^1.0.0 copied to clipboard
Olwnext dropzone widget
owlnext-dropzone #
Owlnext dropzone wrapper
FileUtils.downloadFile() injection #
- with universal_html: ^2.2.4
if you want to use FileUtils.downloadFile() on web context, you will need to inject a specific behavior from your app. create a file in your app, loaded only in library.html context (web) and call
import 'package:universal_html/html.dart';
void setup() {
DownloadFileWebBypass().setDownloadFileWebFunction(_downloadFileWebImplementation);
}
Future<void> _downloadFileWebImplementation(Uint8List bytes, String fileName, String extension) async {
final base64 = base64Encode(bytes);
// Create the link with the file
final anchor = AnchorElement(
href: 'data:application/octet-stream;base64,$base64')
..target = 'blank'
..download = fileName;
// trigger download
document.body?.append(anchor);
anchor.click();
anchor.remove();
}