Search packages, repositories and app categories

Package detailsv3.3.6

flutter_file_dialog

Dialogs for picking and saving files in Android and in iOS.

AndroidiOS
30-day downloads
106K
Likes
110
Pub points
160

Install package

flutter pub add flutter_file_dialog

Package Overview

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

A Flutter package providing native file picker and saver dialogs for Android and iOS. It enables users to select files from their device or save files through system-native interfaces, ensuring a consistent experience across platforms. The package integrates seamlessly with Flutter apps, offering simple APIs to trigger file operations without requiring custom UIs. It supports common file types and respects platform-specific file access permissions and restrictions.

Use cases

  • Selecting files from device storage
  • Saving files to device
  • Integrating native file dialogs in cross-platform apps
  • Handling file input in media or document apps
  • Enabling user-driven file management
  • Supporting file import/export workflows

Key features

  • Native dialog integration on Android and iOS
  • Simple API for file picking and saving
  • Cross-platform compatibility
  • Respects platform-specific file access rules
  • Minimal setup required
  • Supports common file types

Suitable for

  • Apps needing file selection or saving
  • Developers targeting both Android and iOS
  • Projects requiring native file UIs
  • Media or document management applications
  • Apps with user-driven file handling needs

Considerations

  • Requires appropriate platform permissions
  • Limited to file pick/save operations only
  • No support for web or desktop platforms
  • Depends on native OS file system access
  • May require additional configuration for specific file types

Original README

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

flutter_file_dialog

Dialogs for picking and saving files and for picking directories in Android and in iOS.

Features

  • Supports Android (API level 24 or later) and iOS (13.0 or later).
  • Modern plugin implementation based on Kotlin (Android) and Swift (iOS).
  • Pick image files and other documents.
  • Save a file to a selected location.
  • Pick a directory and save files to the picked directory without further dialogs.
  • iOS dialog types: document and image.
  • iOS source types: camera, photo library, saved photos album.
  • Allow user to edit the picked image in iOS.
  • Set file extension filter and mime types filter when picking a document.
  • Possibility to limit picking a file from the local device only (Android).

Examples

Pick an image file
  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType.image,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);
Pick a document
  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);
Save a file
final params = SaveFileDialogParams(sourceFilePath: "path_of_file_to_save");
final filePath = await FlutterFileDialog.saveFile(params: params);
print(filePath);
Pick a directory and save a file to the picked directory
if (!await FlutterFileDialog.isPickDirectorySupported()) {
  print("Picking directory not supported");
  return;
}

final pickedDirectory = await FlutterFileDialog.pickDirectory();

if (pickedDirectory != null) {
  final filePath = await FlutterFileDialog.saveFileToDirectory(
    directory: pickedDirectory!,
    data: file.readAsBytesSync(),
    mimeType: "image/jpeg",
    fileName: "fileName.jpeg",
    replace: true,
  );
}
Optimize picked image file using flutter_image_utilities

Use the plugin flutter_image_utilities to optimize a picked image file.

  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType.image,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);

  if (filePath != null) {
    final pickedFile = File(filePath)

    // optimize the image file
    final optimizedFile = await FlutterImageUtilities.saveAsJpeg(
      sourceFile: pickedFile,
      quality: 60,
      maxWidth: 1920,
      maxHeight: 1024,
    );
  }

Categories

Source repository

Projects using this package