owlnext_dropzone 0.1.3 copy "owlnext_dropzone: ^0.1.3" to clipboard
owlnext_dropzone: ^0.1.3 copied to clipboard

Olwnext dropzone widget

owlnext-dropzone #

Owlnext dropzone wrapper

Pub Publisher Pub Version GitHub Actions Workflow Status GitHub License

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();
  }