wasm_ffi 2.4.0 copy "wasm_ffi: ^2.4.0" to clipboard
wasm_ffi: ^2.4.0 copied to clipboard

Platformweb

A wrapper for wasm which can be used as a drop-in replacement for dart:ffi for Web platform.

example/README.md

Vanilla Dart example #

This example is a small Dart web application that loads the checked-in standalone and Emscripten WebAssembly assets and invokes generated bindings.

Files #

  • web/main.dart — browser entry point; it loads both module variants and adds their results to the page.
  • lib/example_library_wrapper.dart — high-level wrapper using DynamicLibrary.open and the web string helpers.
  • lib/native_example_bindings.dart — bindings generated by ffigen.
  • web/assets/ — standalone .wasm and Emscripten .js/.wasm assets.
  • src/ — native source used to produce the example assets.

Run #

From this directory:

dart pub get
dart run ffigen --config ffigen.yaml
webdev serve

Open the URL printed by webdev in Chrome. The application requires an HTTP server because the browser fetches the WebAssembly assets.

The root README.md documents the package API and the Flutter example.

16
likes
160
points
20.5k
downloads

Documentation

API reference

Publisher

verified publishervm75.duckdns.org

Weekly Downloads

A wrapper for wasm which can be used as a drop-in replacement for dart:ffi for Web platform.

Repository (GitHub)
View/report issues

Topics

#ffi #wasm #native #web

License

BSD-2-Clause (license)

Dependencies

ffi, http, meta, path, web

More

Packages that depend on wasm_ffi