Search packages, repositories and app categories

Package detailsv2.0.0

document_file_save_plus

Save bytes data into Download folder (Android), or show save dialog (iOS).

AndroidiOS
30-day downloads
4.4K
Likes
55
Pub points
130

Install package

flutter pub add document_file_save_plus

Package Overview

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

A Flutter package that enables saving byte data to the device's Download folder on Android or displaying a save dialog on iOS. It simplifies file persistence across platforms by handling platform-specific behaviors automatically. Ideal for apps needing to export files like PDFs, images, or documents without complex native code. The package supports both direct downloads and user-controlled saves, ensuring compatibility with modern OS restrictions. It integrates seamlessly into existing workflows with minimal setup.

Use cases

  • Exporting generated PDFs
  • Saving image or audio files
  • Sharing app-generated documents
  • Handling file exports in cross-platform apps
  • Enabling user-controlled file saving on iOS

Key features

  • Platform-specific file saving
  • Automatic download folder access on Android
  • Save dialog on iOS
  • Simple byte data input
  • Cross-platform compatibility
  • Minimal configuration required

Suitable for

  • Apps requiring file export functionality
  • Developers targeting both Android and iOS
  • Projects involving document or media generation
  • Apps needing compliance with iOS file-saving guidelines
  • Teams avoiding native platform code

Considerations

  • Requires appropriate permissions on Android
  • iOS users must confirm save actions
  • Limited to Download folder on Android
  • No support for custom file paths
  • Depends on platform-specific system dialogs

Original README

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

document_file_save_plus

Save bytes data into Download folder (Android), or show save dialog (iOS). You can save any file types (Ex. .txt, .png, .jpg, .pdf, etc)

Install plugin

add this line into pubspec.yaml

document_file_save_plus: ^1.0.4

Permission

Android

if your project set android target >= Android Q, you don't have to add any permission. Otherwise, Add the following statement in AndroidManifest.xml:

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

No permission needed.

Function description

// call function 'saveFile' if you 1 file to save.
void saveFile(Uint8List data, String fileName, String mimeType)

// call function 'saveMultipleFiles' if you have mutiple files to save. iOS will show save dialog only once
void saveMultipleFiles(List<Uint8List> dataList, List<String> fileNameList, List<String> mimeTypeList)

Example usage

import 'package:document_file_save_plus/document_file_save_plus.dart';

//Save multiple files
List<int> textBytes = utf8.encode("Some data");
List<int> textBytes2 = utf8.encode("Another data");
DocumentFileSave.saveMultipleFiles([textBytes, textBytes2], ["text1.txt", "text2.txt"], ["text/plain", "text/plain"]);

//Save single text file
DocumentFileSave.saveFile(textBytes, "my_sample_file.txt", "text/plain");

//Save single pdf file
DocumentFileSave.saveFile(pdfBytes, "my_sample_file.pdf", "appliation/pdf");

//Save single image file
DocumentFileSave.saveFile(imageJPGBytes, "my_sample_file.jpg", "image/jpeg");

Categories

Dependencies

Dependency list 1 items

  • plugin_platform_interface^2.1.3

Source repository

Projects using this package

No data available yet.