openAsync method

Future<DynamicLibrary> openAsync(
  1. String path
)

Asynchronously opens a dynamic library from the specified path. The ffi:DynamicLibrary.open is synchronous, but wasm_ffi:DynamicLibrary.open is asynchronous. This helper method uses both asynchronously.

path: The file path to the dynamic library to be opened.

Returns a Future that completes with the opened DynamicLibrary instance. Throws an ArgumentError if the library cannot be opened.

Implementation

Future<DynamicLibrary> openAsync(String path) async {
  final lib = await DynamicLibrary.open(path);
  return lib;
}