openFile method

Future<void> openFile(
  1. String filePath
)

Opens a file from the given path.

The behavior differs by platform:

  • On mobile/desktop: Opens the file using the default application via openfilex
  • On web: Opens the file in a new browser tab

Parameters:

  • filePath: The path of the file to open (for native) or URL (for web)

Throws:

  • May throw exceptions if the file cannot be opened.

Implementation

Future<void> openFile(String filePath) async {
  await platform.openFile(filePath);
}