flutter_file_saver 0.4.0 copy "flutter_file_saver: ^0.4.0" to clipboard
flutter_file_saver: ^0.4.0 copied to clipboard

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

flutter_file_saver #

Pub Version

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

Setup #

Android #

In your android/app/src/main/AndroidManifest.xml, add the WRITE_EXTERNAL_STORAGE, MANAGE_EXTERNAL_STORAGE permissions and the android:requestLegacyExternalStorage="true":

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.my_app">
    <!-- ... -->

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

    <application android:requestLegacyExternalStorage="true" android:label="MyApp" android:name="${applicationName}">
        <!-- ... -->
    </application>
</manifest>

iOS #

Add the following permissions to your ios/Runner/Info.plist:

<key>UISupportsDocumentBrowser</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>

MacOS #

Add the following permissions to your macos/Runner/DebugProfile.entitlements:

<key>com.apple.security.files.user-selected.read-write</key>
<true/>

TODO #

  • Use method channel on Android to save the file in the download folder
  • Support for Windows & Linux
  • Support custom paths
  • Improve documentation
  • Add tests