Search packages, repositories and app categories

Package detailsv0.0.2+1

cr_file_saver

Allows to save files on Android and IOS devices and request permission if needed.

AndroidiOS
30-day downloads
8
Likes
34
Pub points
150

Install package

flutter pub add cr_file_saver

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

cr_file_saver is a Flutter package that enables saving files to Android and iOS devices, handling permission requests automatically when required. It simplifies file operations by abstracting platform-specific details, making it easy to store files like images, documents, or data exports directly on the user's device. The package integrates seamlessly with Flutter apps and supports both platforms with consistent APIs. It’s ideal for applications needing offline file storage or export functionality.

Use cases

  • Saving exported documents
  • Storing app-generated images
  • Exporting data to local storage
  • Handling file downloads
  • Managing user-generated content

Key features

  • Automatic permission handling
  • Cross-platform support (Android & iOS)
  • Simple API for file saving
  • Supports various file types
  • Built-in error management

Suitable for

  • Apps requiring file export
  • Media-heavy applications
  • Offline data storage
  • Document management tools
  • User content saving

Considerations

  • Requires runtime permissions on Android
  • Limited to file saving (no reading)
  • Platform-specific behavior may vary
  • No built-in file browsing
  • Depends on native OS file system access

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

cr_file_saver

Header image

Cleveroad introduces file saver for Flutter

Features:
  • Request WriteExternalStoragePermission for Android if needed.
  • Save file to downloads directory on Android or Document folder on IOS.
  • Save file through standard file saving dialog.
Future features:
  • Saving file to a specific directory.

Setup

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  cr_file_saver: ^0.0.2
Android:

If you are using android 9 and below add this permission to project manifest:

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

Add permissions in ios folder, go to ios/Runner/info.plist and add next keys:

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

In your dart file add the following import:

import 'package:cr_file_saver/cr_file_saver.dart';

Usage

CRFileSaver has several static methods to work with:

  • requestWriteExternalStoragePermission to check for permission and ask it if needed.
  • saveFile simply saving file with provided file path and desired file name.
  • saveFileWithDialog save file through standard file saving dialog. Note that this method will throw NoResolvedActivityException if Android device has 30 api or higher

Categories

Dependencies

Dependency list 1 items

  • plugin_platform_interface^2.1.2

Source repository

Projects using this package