Skip to content
pubscout

file_system_access_api

2.0.0, released 3 years ago by louispoirier.io

Dart library exposing the browser File System Access API for web apps.

$ flutter pub add file_system_access_api
Source repository

What it does

Provides Dart bindings to the experimental Web File System Access API. Allows web apps to open, save, and manipulate files and directories chosen by the user, including drag‑and‑drop support.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to read or write user‑selected files or directories in a Flutter web app.
  • You want native‑like file dialogs and directory traversal on supported browsers.

Skip it when

  • Your app runs on mobile, desktop, or unsupported browsers.
  • You require a stable, production‑ready file system solution.

Strengths

  • Direct access to the browser's native file system API
  • Supports open, save, and directory pickers
  • Provides stream of directory entries for watch‑like behavior
  • Includes drag‑and‑drop handling

Weaknesses

  • Experimental and only works on Chrome, Edge, Opera
  • Not recommended for production use
  • No fallback for unsupported browsers

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Add the package to pubspec, import it, and guard usage with `kIsWeb` to avoid build/runtime errors.

void main() async {
  if (!FileSystemAccess.supported) return;
  final handles = await window.showOpenFilePicker(multiple: true);
  for (final handle in handles) {
    final file = await handle.getFile();
    print('<file name="${handle.name}" size="${file.size}" />');
  }
}

Alternatives

Packages that do the same job and could replace file_system_access_api.

  • path_provider

    Provides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.

  • open_app_file

    Open files with default system-provided applications.

  • watcher

    Monitors file system changes and notifies when files are added, removed, or modified.

  • saf

    Access and manage files and folders via Android Storage Access Framework