showInFolder static method

Future<bool> showInFolder({
  1. required String path,
  2. Uint8List? bookmark,
})

Reveal a file on disk in the system's file browser.

  • macOS: opens (or surfaces) a Finder window with the file selected (NSWorkspace.activateFileViewerSelecting).
  • Windows: opens an Explorer window on the file's folder with the file selected.
  • All other platforms: no-op, returns false.

Returns true when Finder or Explorer accepted the request.

Implementation

static Future<bool> showInFolder({
  required String path,
  Uint8List? bookmark,
}) async {
  if (!supportsShowInFolder) return false;
  final result = await _channel.invokeMethod<bool>('showInFolder', {
    'path': path,
    'bookmark': ?bookmark,
  });
  return result ?? false;
}