Network access in Web #1484
-
Hello, I'm exploring the Flutter Rust Bridge for web development and have concerns about network access limitations in WASM. I'm curious about:
Looking forward to your insights. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Good question! Firstly, there seems to be some Rust crates to wrap the native js's Secondly, FRB v2 introduces "Rust call Dart" feature https://cjycode.com/flutter_rust_bridge/guides/direction/rust-call-dart. So you can write a Dart function that does network request (e.g. |
Beta Was this translation helpful? Give feedback.
Good question!
Firstly, there seems to be some Rust crates to wrap the native js's
fetch
, etc https://stackoverflow.com/questions/66397775/how-do-i-make-an-http-request-within-a-wasm-bindgen-function-in-rustSecondly, FRB v2 introduces "Rust call Dart" feature https://cjycode.com/flutter_rust_bridge/guides/direction/rust-call-dart. So you can write a Dart function that does network request (e.g.
Future<String> myDartFunctionThatReqeusts(String url) { ... }
, and call it from Rust.