file_saver 0.2.7 file_saver: ^0.2.7 copied to clipboard
This package will help you save file with a single method on any platform including macOS, iOS, Android, Windows, Web, Linux.
Changelog #
All notable changes to this project will be documented in this file.
[0.2.6] #
- Merged ([PR70])(https://github.com/incrediblezayed/file_saver/pull/70), resolving the issue ([#42])(https://github.com/incrediblezayed/file_saver/issues/42)
[0.2.5] #
- Added apng mime type
- Added custom mimetype
So basically if you have a custom mimetype and it does not exists in the given enum, you can add your own mimeType using the field \
String? customMimeType,
and you will have to set the mimetype to custom and call the method like
await FileSaver.instance.saveFile(
name: "FileName",
link: "www.example.com/file.extention",
filePath: "pathOfFile",
file: File(),
bytes: bytes,
ext: "extention",
customMimeType: 'YourCustomType',
mimeType: MimeType.custom);
- Fixed repeated extension when using saveAs with MimeType.other on iOS (GitHub issue #65)
[0.2.4] #
- Bug Fix -> Link Details not available publically
[0.2.3] #
- Replaced the
String? link
withLinkDetails? link
in order to add headers with the link for downloading file - Fixed (GitHub issue #59)
0.2.2 #
- Implemented the web platform without method channel, using the conditional imports.
0.2.1 #
- Fixed a bug in web (git issue #57)
- Updated dart version constraints
- Updated MimeType enum to enhanced enum (from dart 2.17.0) and removed method getMimetype(), if you want to get the mimeType from the enum you can directly write
MimeType.pdf.type
And if you want the formatted name of the given type, you can get it by
MimeType.pdf.name
0.2.0 #
-
Fixed several issues from github
-
Feature Added a parameter link for saving file directly through network
-
Feature Added filePath if you have the filepath, no need to get the bytes of the file, you can directly pass the path in filePath parameter and the file_saver will do the rest
-
Feature Added file parameter to direct save the file from File object
-
Regardless of all the new options for saving files, bytes parameter is still there and you can still use it but, All the parameters are optional now so you have to use atleast one of these parameter (link, filePath, file, bytes)
-
Changed all the parameters to named instead of positional so now instead of
await FileSaver.instance.saveFile("FileName", bytes, "extension", mimeType: mimeType); await FileSaver.instance.saveAs("File", bytes, "extension", type);
you will have to use
await FileSaver.instance.saveFile( name: "FileName", link: "www.example.com/file.extention", filePath: "pathOfFile", file: File(), bytes: bytes, ext: "extention", mimeType: type); await FileSaver.instance.saveFile( name: "FileName", link: "www.example.com/file.extention", filePath: "pathOfFile", file: File(), bytes: bytes, ext: "extention", mimeType: type);
link, filePath, bytes & file are all optional parameters but any one of these parameter is required and thus you can use any one of these parameter as per your requirement #
-
Changed the MimeType enum values to lower case (as per dart's naming conventions)
-
Upgraded everything to latest versions (gradle tools = 7.4.2, kotlin=1.8.0)
0.1.1 #
- Updated the pub to the latest commit, fixing the issues with flutter 3.
0.1.0 #
- Fixed the incomplete path in saveFile method (GitHub issue #16)
- Fixed some crashes in some folders on saveAs method with the help of this answer
- Fixed application crash issue reply already submitted with the help of this suggestion (GitHub issue #14)
- Fixed Wrong or missing file extension when calling saveAs() (GitHub issue #20)
0.0.12 #
- Fixed Path Provider version
0.0.11 #
- Updated Readme
- Upgraded Path Provider
- Updated Kotlin version to 1.16.10
0.0.10 #
- Updated Readme
- Due to security reasons, I'm not able to save the files to downloads folder in android, if anyone has any idea that would work on Android 11 so please connect.
0.0.9 #
- Android Permission Bug Fixed
- Other bugs fixes
0.0.8 #
- Minor Bug Fixes
- Updated Readme
0.0.7 #
- Added Save as method for Android and iOS, more coming soon
- Bug fixes & Suggestions (Reported on Github)
0.0.6 #
- Added More File Types
0.0.5 #
- Minor Bug Fixes
0.0.4 #
- saveFile method returns the path where the file is saved.
0.0.3 #
- Minor Bug Fixes
0.0.2 #
- Updated Guide
0.0.1 #
- File Saver for all platforms