openFile method

Future<void> openFile(
  1. File file
)

Opens the file.

Implementation

Future<void> openFile(io.File file) async {
  if (isTopLevelWindowInsideBrowser) {
    throw StateError('Failed to mutate the main window inside a browser');
  }
  final content = await file.readAsString();
  return openContent(content);
}