saf library

Flutter plugin for the Android Storage Access Framework (SAF): directory/file pickers, persisted permissions, file management with recursive walk, streamed read/write with progress, and local-file bridging — in a single Saf class.

See the project page for usage examples.

Classes

FileTypes
To get the types for File statically
LegacySaf
The legacy 1.x path-based API.
Saf
Android Storage Access Framework client.
SafDocumentFile
Metadata for a SAF document (file or directory).
SafOpenFd
A live file descriptor opened via Saf.openFileDescriptor.
SafPersistedPermission
A persisted URI permission grant held by the app.
SafPlatform
The interface that platform implementations of saf v2 must implement.
SafProgress
Progress of a long-running copy/move/paste operation.
SafWalkEntry
One entry emitted by Saf.walk.

Typedefs

SafProgressCallback = void Function(SafProgress progress)
Callback for SafProgress updates.

Exceptions / Errors

SafAlreadyExistsException
A document with the same name already exists.
SafException
Base class for all failures thrown by the v2 Saf API.
SafIoException
Any other I/O failure.
SafNotFoundException
The target document does not exist.
SafPermissionException
The app lacks (persisted) permission for the target URI.