saf

Creator: coderz1093

Last updated:

Add to Cart

Description:

saf

Saf #
Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.
Currently supported features #

Uses OS default native file explorer
Access the hidden folder and files
Accessing directories
Caching the files inside the app External files directory
Syncing the files of some directory with cached one
Different default type filtering (media, image, video, audio or any)
Support Android

If you have any feature that you want to see in this package, please feel free to issue a suggestion. 🎉
Example App #
Android

Usage #
To use this plugin, add saf as a dependency in your pubspec.yaml file.
Initiate Saf with instance #
Saf saf = Saf("~/some/path")
copied to clipboard
Directory Permission request
bool? isGranted = await saf.getDirectoryPermission(isDynamic: false);

if (isGranted != null && isGranted) {
// Perform some file operations
} else {
// failed to get the permission
}
copied to clipboard
Get the list of all the paths for the Granted Directories

bool? directoriesPath = await saf.getPersistedPermissionDirectories();

copied to clipboard
Get paths of all the files for current directory

List<String>? paths = await saf.getFilesPath(FileType.media);

copied to clipboard
Cache the current directory

bool? isCached = await saf.cache();

if (isCached != null && isCached) {
// Perform some file operations
} else {
// failed to cache
}

copied to clipboard
Get the cached files' path for current directory

List<String>? cachedFilesPath = await saf.getCachedFilesPath();

copied to clipboard
Clear cache for the current directory

bool? isClear = await saf.clearCache();

copied to clipboard
Sync the current directory with the cached one

bool? isSynced = await saf.sync();

copied to clipboard
Release the persisted permission for current directory

bool? isReleased = await Saf.releasePersistedPermission();

copied to clipboard
Release the persisted permissions for all the granted directories

await Saf.releasePersistedPermissions();

copied to clipboard
Documentation #
See the Saf Wiki for every detail on about how to install, setup and use it.
Saf Wiki #

Installation
Setup

Android


API

Methods
Parameters
Filters


FAQ
Troubleshooting

For full usage details refer to the Wiki above.
Getting Started #
For help getting started with Flutter, view our online
documentation.
For help on editing plugin code, view the documentation.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.