incrediblezayed / file_saver

A simple flutter plugin for saving files in all platforms
https://pub.dev/packages/file_saver
BSD 3-Clause "New" or "Revised" License
75 stars 92 forks source link

Unhandled Exception: type 'String' is not a subtype of type 'Uint8List' #103

Closed myxzlpltk closed 4 months ago

myxzlpltk commented 4 months ago

I only use this block code

FileSaver.instance.saveFile(name: 'bitcoin.pdf', link: LinkDetails(link: 'https://bitcoinwhitepaper.co/bitcoin.pdf'));

But then this error show. What went wrong?

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'String' is not a subtype of type 'Uint8List'
#0      Helpers._getBytesFromLink (package:file_saver/src/utils/helpers.dart:50:15)
<asynchronous suspension>
#1      FileSaver.saveFile (package:file_saver/file_saver.dart:71:11)
<asynchronous suspension>

Version: file_saver: ^0.2.11

incrediblezayed commented 4 months ago

Did you fix it? @myxzlpltk

myxzlpltk commented 4 months ago

It already here in main branch, but still not rolled in pub.dev https://github.com/incrediblezayed/file_saver/blob/13fb3b1eb92016553d28d1752b4d8f4af7e07a4e/lib/src/utils/helpers.dart#L42

incrediblezayed commented 4 months ago

I'll update asap, thanks