openFile method

Future<void> openFile(
  1. Uri uri, {
  2. String? mimeType,
})

Opens a saved file with the appropriate system app.

Platforms: Android · iOS · macOS · Windows · Linux Web: throws UnsupportedError — files are already browser-downloaded.

uri should be a Uri returned from a save operation (for example SaveProgressComplete.uri, or a write-session result like FileSaverSink.result).

mimeType is optional. On Android, it is queried from ContentResolver for content:// URIs if not provided.

Android note: If uri is a file://... URI, the host app may need to configure a FileProvider to open it.

iOS note: ph:// URIs are opened via a system preview (QuickLook).

Implementation

Future<void> openFile(Uri uri, {String? mimeType}) {
  throw UnimplementedError('openFile is not implemented on this platform');
}