GithubHelp home page GithubHelp logo

many-fac3d-g0d / saf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ivehement/saf

1.0 0.0 0.0 2.08 MB

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

Home Page: https://pub.dev/packages/saf

License: MIT License

Kotlin 51.23% Dart 48.77%

saf's Introduction

saf

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

Demo

Usage

To use this plugin, add saf as a dependency in your pubspec.yaml file.

Initiate Saf with instance

Saf saf = Saf("~/some/path")

Directory Permission request

bool? isGranted = await saf.getDirectoryPermission(isDynamic: false);

if (isGranted != null && isGranted) {
  // Perform some file operations
} else {
  // failed to get the permission
}

Get the list of all the paths for the Granted Directories

bool? directoriesPath = await saf.getPersistedPermissionDirectories();

Get paths of all the files for current directory

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

Cache the current directory

bool? isCached = await saf.cache();

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

Get the cached files' path for current directory

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

Clear cache for the current directory

bool? isClear = await saf.clearCache();

Sync the current directory with the cached one

bool? isSynced = await saf.sync();

Release the persisted permission for current directory

bool? isReleased = await Saf.releasePersistedPermission();

Release the persisted permissions for all the granted directories

await Saf.releasePersistedPermissions();

Documentation

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

Saf Wiki

  1. Installation
  2. Setup
  3. API
  4. FAQ
  5. 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.

saf's People

Contributors

jvoltci avatar amuelleratahs avatar jibexlabs avatar

Stargazers

Burden Haze  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.