file_saver 0.0.1
file_saver: ^0.0.1 copied to clipboard
This package will help you save file with a single method on any platform including macOS, iOS, Android, Windows, Web, Linux.
FileSaver #
This plugin package is not much but only for saving files in Android, iOS and Web. The package depends on path_provider for Android and iOS and basic html anchor for Web The main reason I built this plugin was to avoid using html only for downloading files. The plugin is pretty simple and saves the file in Documents folder in android and iOS and directly downloads the file in Web.
Getting Started #
The plugin itself is pretty easy to use. Just call the method saveFile()
FileSaver.instance.saveFile(String name,List<int> bytes,String ext, mimeType: MimeType);
and call saveFile() with respective parameter. This saveFile() method takes 3 Positional Arguments. String name which takes the name of the file, Uint8List bytes which will be your actual encoded file, String ext this will be your file extension. 1 Optional Named Argument Specificall for Web MimeType type which will be your file type, MimeType is also included in my Package, I've included types for Sheets, Presentation, Word, Plain Text, PDF, MP3, MP4 and many other common formats