resolveBookmark method

Future<FileSystemEntity> resolveBookmark(
  1. String bookmark, {
  2. bool isDirectory = false,
})

Converts the given bookmark, created previously with bookmark back into either a File or a Directory depending on the optional value of isDirectory, which defaults to false. Before accessing it, it is still required to call startAccessingSecurityScopedResource

Implementation

Future<FileSystemEntity> resolveBookmark(String bookmark,
    {bool isDirectory = false}) async {
  final String filePath = await _channel
      .invokeMethod('URLByResolvingBookmarkData', {'bookmark': bookmark});
  if (isDirectory) {
    return Directory(filePath);
  } else {
    return File(filePath);
  }
}