Skip to content

Network access in Web #1484

Answered by fzyzcjy
vincent-herlemont asked this question in Q&A
Dec 23, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

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-rust

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. Future<String> myDartFunctionThatReqeusts(String url) { ... }, and call it from Rust.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@vincent-herlemont
Comment options

@fzyzcjy
Comment options

Answer selected by vincent-herlemont
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants