downloadBytes function

void downloadBytes(
  1. List<int> bytes,
  2. MimeType mimeType,
  3. String fileName
)

Downloads bytes of type mimeType, saving a file with fileName.

Implementation

void downloadBytes(List<int> bytes, MimeType mimeType, String fileName) {
  // A single typed array part (a part per byte would be stringified):
  var blob = Blob(
    [Uint8List.fromList(bytes).toJS].toJS,
    BlobPropertyBag(type: mimeType.toString()),
  );
  downloadBlob(blob, fileName);
}