brickpop/flutter-rust-ffi

Web support?

Closed this issue ยท 3 comments

Is it possible to call Rust from Flutter Web using wasm?

It is possible ๐Ÿ˜‰ I was able to do it with a wrapper using wasmer in rust ๐Ÿ’ช๐Ÿป

Can you make a PR for this repo? That would be great, as flutter-rs will probably turn out to be a dead end for now. This seems to be a much better approach.

This boilerplate is focused towards loading native libraries on mobile flutter apps. Adding desktop support should not be difficult, but Flutter Web is a different creature.

As of now, I think there is no official support to handle wasm libraries from flutter web. The repo could be easily adapted to also generate wasm files, but the integration on a web would need to be done from the main HTML body, hacky ad dirty.

Meanwhile, you can have a look at wasm-pack after you add the wasm32-unknown-unknown Rust target.