loadFile method

  1. @override
Future<void> loadFile(
  1. String absoluteFilePath
)
override

Loads the file located on the specified absoluteFilePath.

The absoluteFilePath parameter should contain the absolute path to the file as it is stored on the device. For example: /Users/username/Documents/www/index.html.

Throws an ArgumentError if the absoluteFilePath does not exist.

Implementation

@override
Future<void> loadFile(String absoluteFilePath) async {
  assert(absoluteFilePath != null);

  try {
    return await _channel.invokeMethod<void>('loadFile', absoluteFilePath);
  } on PlatformException catch (ex) {
    if (ex.code == 'loadFile_failed') {
      throw ArgumentError(ex.message);
    }

    rethrow;
  }
}