owlnext_dropzone 0.1.4
owlnext_dropzone: ^0.1.4 copied to clipboard
Olwnext dropzone widget
owlnext-dropzone #
Owlnext dropzone wrapper
to abstract implement web you cas use #
- 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();
}