flutter_file_saver

Last updated:

0 purchases

flutter_file_saver Image
flutter_file_saver Images
Add to Cart

Description:

flutter file saver

flutter_file_saver #


Interface to provide a way to save files on the device in Flutter.
Platform Support #




Android
iOS
Web
Windows
Linux
MacOS




writeFileAsBytes



❌️
❌️



writeFileAsString



❌️
❌️




Getting Started #
Import the package #
dependencies:
flutter_file_saver: any
copied to clipboard
Platform Setup #

Android Setup
android {
defaultConfig {
minSdkVersion 19
}
}
copied to clipboard
Check example


iOS Setup
Add the following permissions to your ios/Runner/Info.plist:
<key>UISupportsDocumentBrowser</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
copied to clipboard
Check example


MacOS Setup
Add the following permissions to your macos/Runner/DebugProfile.entitlements:
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
copied to clipboard
Check example

Methods #
writeFileAsBytes #
Write a file on the device from a Uint8List.
FlutterFileSaver().writeFileAsBytes(
fileName: 'file.txt',
bytes: fileBytes,
);
copied to clipboard
writeFileAsString #
Write a file on the device from a String. This will most of the time convert your data and perform a call to writeFileAsBytes.
FlutterFileSaver().writeFileAsString(
fileName: 'file.txt',
string: 'Hello World!',
);
copied to clipboard
Todo #

Support for Windows & Linux
Support custom local paths

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.