macos_secure_bookmarks 0.1.0 copy "macos_secure_bookmarks: ^0.1.0" to clipboard
macos_secure_bookmarks: ^0.1.0 copied to clipboard

outdated

Flutter desktop plugin for managing secure bookmarks to access files in sandbox.

macos_secure_bookmarks #

Flutter plugin to create secure bookmarks to keep access to files in sandboxed apps.

Usage #

Creating Security Scoped Bookmarks #

// First let the user choose a file, e.g. using the file chooser plugin.

showOpenPanel((result, files) {
  if (result != FileChooserResult.ok || files.isEmpty) {
    return;
  }
  
  // Now create a security scoped bookmark
  final secureBookmarks = SecureBookmarks();
  final bookmark = await _secureBookmarks.bookmark(File(_file));
  
  // Now store the bookmark somewhere for later invocations
});

Resolving and accessing bookmarks #

// resolve bookmark from persistet 'bookmark' string from earlier
final resolvedFile = await _secureBookmarks.resolveBookmark(_bookmark);
// resolved is now a File object, but before accessing it, call:
await startAccessingSecurityScopedResource(resolvedFile);

// now read/write the file

// and later give up access.
await stopAccessingSecurityScopedResource(resolvedFile);

12
likes
0
pub points
81%
popularity

Publisher

verified publishercodeux.design

Flutter desktop plugin for managing secure bookmarks to access files in sandbox.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, logging, logging_appenders

More

Packages that depend on macos_secure_bookmarks