owlnext_dropzone 0.1.1 copy "owlnext_dropzone: ^0.1.1" to clipboard
owlnext_dropzone: ^0.1.1 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';

DownloadFileWebBypass().setDownloadFileWebFunction(
  try {
    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();

    return null;
  } catch (e) {        
    throw(FileError.genericError);
  }
)