Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.
- 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. 🎉
To use this plugin, add saf
as a dependency in your pubspec.yaml file.
Saf saf = Saf("~/some/path")
bool? isGranted = await saf.getDirectoryPermission(isDynamic: false);
if (isGranted != null && isGranted) {
// Perform some file operations
} else {
// failed to get the permission
}
bool? directoriesPath = await saf.getPersistedPermissionDirectories();
List<String>? paths = await saf.getFilesPath(FileType.media);
bool? isCached = await saf.cache();
if (isCached != null && isCached) {
// Perform some file operations
} else {
// failed to cache
}
List<String>? cachedFilesPath = await saf.getCachedFilesPath();
bool? isClear = await saf.clearCache();
bool? isSynced = await saf.sync();
bool? isReleased = await Saf.releasePersistedPermission();
await Saf.releasePersistedPermissions();
See the Saf Wiki for every detail on about how to install, setup and use it.
For full usage details refer to the Wiki above.
For help getting started with Flutter, view our online documentation.
For help on editing plugin code, view the documentation.