A flutter plugin for macOS to open files or view files in Finder.
import 'package:open_file_macos/open_file_macos.dart';
final _openFileMacosPlugin = OpenFileMacos();
// Open a file.
await _openFileMacosPlugin.open('path/to/a/file');
// Open a file in Finder.
await _openFileMacosPlugin.open('path/to/a/file', viewInFinder: true);
As the package name suggests, this package only focuses on a clean implementation on macOS.
To open files on other platforms, you can find plenty of alternatives on pub.dev.
To view files in explorer on Windows:
await Process.run('explorer.exe', ['/select,$path']);